36

As most of you know, it is possible to open a new Command Line in the current folder from the file explorer. For this you have to write 'cmd' in the folder path.

Is there a way to do this with the new Windows Terminal (Preview) yet? As this is currently my preferred shell.

Keimeno
  • 471

7 Answers7

64

You can try this command in the folder path:

wt -d .

source

EDIT: Microsoft mentions the previous command in one of their videos alongside with many interesting features of Windows Terminal 1.0

Alex R.
  • 740
  • 1
  • 5
  • 5
53

To fix this:

  • Open Windows Terminal
  • Click the down arrow in the toolbar to get the menu and select "Settings"
  • Update your profiles.json defaults so that all shells starting directory is the current directory

    "profiles": {
        "defaults": {
           // Put settings here that you want to apply to all profiles
           "startingDirectory": "."
        }...
    

From at least v0.9.433.0 on Windows 10 onwards the default value for "startingDirectory" in defaults.json on my machine is "%USERPROFILE%", which means typing "wt" in an explorer window opens in your home directory, not the current folder.

Edward
  • 539
26

Simply type in wt in the address bar and it will open the command prompt with the path to your current folder already set. Make sure that your settings do not overwrite startingDirectory.

enter image description here

Ramhound
  • 44,080
2

For quite some time, there is a PowerShell module called OpenHere that gives you granular options to control this functionality.

All you need is to copy paste this into PowerShell with elevated rights:

Install-Module -Name OpenHere; Import-Module -Name OpenHere

and start to explore the Set-OpenHereShortcut function.

Disclosure:

I'm a developer of this module.

KUTlime
  • 131
  • 3
1

I just did this:

  1. Open windows terminal
  2. Click (+) and select configuration
  3. Go to Default Values in the side navigation bar
  4. Click on starting directory
  5. Set value to .
  6. Save settings
  7. Try to open from folder typing wt in navigation bar
Toto
  • 19,304
Jesús
  • 11
  • 1
0

Follow this link. It's an awesome article to open the terminal in the exact folder like Linux. (Thank you @DarkDiamond) Here is the process:

  1. To add the Open command window here option to the context menu that displays when you right-click on a folder, press the Windows key + R to open the Run dialog box.
  2. type: regedit into the Open box and click OK.
  3. Navigate to this path: HKEY_CLASSES_ROOT\Directory\shell\cmd
  4. Take ownership of the cmd key and give yourself full control permission.
  5. Make sure the cmd key is selected. Then, right-click on the HideBasedOnVelocityId value on the right and select Rename.
  6. Change the name of the HideBasedOnVelocityId value to ShowBasedOnVelocityId and press Enter.
  7. Close the Registry Editor and restart the Windows Explorer process.
  8. Now you can Shift + right-click on a folder, not in it, and select Open command window here.
0

What worked for me on Windows 11 is checking "Use parent process directory" under "Starting directory" in terminal profile settings.

AdamTL
  • 1