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.
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:
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:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
|"name": "Windows PowerShell",|
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.