Tip: Launch Windows Terminal quickly from file explorer

Even though I love the new Windows Terminal, I found myself accidentally launching the classic PowerShell prompt from the file explorer via the File menu too often. As far as this GitHub issue says, a way to fully integrate Windows Terminal with the system is planned, but until then, I wanted to find a more convenient way to launch it from the currently displayed folder in file explorer.

The address bar in file explorer allows us to enter a one-liner command and execute it. Windows Terminal registers itself with the wt command-line alias when installed (this is done using AppExecutionAlias declaration in the app manifest, which you can use in your apps as well!). So click the address bar or give it focus using Alt + D shortcut, type wt and press enter. This launches Windows Terminal immediately.

"wt" command typed in file explorer address bar
Press enter for Windows Terminal!

But we are not done yet. Although Windows Terminal launches successfully, by default, it always starts in the default user profile folder, not in the one currently opened in file explorer. To fix this, we need to go into Windows Terminal settings. We can get there by clicking the “down arrow” button in the Terminal tab bar and choosing Settings, or more quickly using the Ctrl + , (comma) shortcut:

Settings menu of Windows Terminal
Settings menu

Our default JSON file editor opens and shows the configured Terminal profiles. The change we need to do is straightforward – we just add a startingDirectory property with the value of . (dot) to each of the profiles. For example:


{
"guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
"name": "Windows PowerShell",
"commandline": "powershell.exe",
"startingDirectory": ".",
"hidden": false
},
{
"guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}",
"name": "cmd",
"commandline": "cmd.exe",
"startingDirectory": ".",
"hidden": false
}

view raw

profiles.json

hosted with ❤ by GitHub

We can save the changes, close text editor, and now try the wt command from file explorer again. We should see Windows Terminal open at the current folder now.

The current folder is now open in Windows Terminal
Current folder now open

 

Buy me a coffeeBuy me a coffee

9 thoughts on “Tip: Launch Windows Terminal quickly from file explorer”

  1. Add this snippet to your PowerShell profile to still start in your home directory when you simply run Windows Terminal fra the start menu:

    if ((gl).Path -eq ‘C:\Windows\system32’) {
    cd ~
    }

  2. I did have one comment to note. I have version 1.3.2651.0 of Windows Terminal, I did have to update the line in settings.json “`”defaultProfile”: “{0caa0dad-35be-5f56-a8ff-afceeeaa6101}”“`, to match the guid of the interface I wanted to open in. My example here is cmd:

    “`
    {
    // Make changes here to the cmd.exe profile.
    “guid”: “{0caa0dad-35be-5f56-a8ff-afceeeaa6101}”,
    “name”: “Command Prompt”,
    “commandline”: “cmd.exe”,
    “startingDirectory”: “.”,
    “hidden”: false
    },
    “`

  3. You can use “use parent process directory” option now, and people that don’t like text files can configure from the menu.

  4. Hi! Great write-up. However, right now I’m running “wt” in the address bar, and it’s opening my web browser. I tried replacing the path with “cmd” instead, and it works!

    I’m in Windows 10.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

*

This site uses Akismet to reduce spam. Learn how your comment data is processed.