How To Open Windows Terminal From the Command Line

The new Windows Terminal is a "Modern" UWP app, which means that it doesn't lend itself to launching from the command-line. Fortunately, there's an easy answer:
> wt

Given how easy that is, I'm not sure if there's any value to this, but you can also launch it via explorer.exe shell, as you can any other Modern app:
> explorer.exe shell:AppsFolder\Microsoft.WindowsTerminal_8wekyb3d8bbwe!App

... or via start
> start "" shell:AppsFolder\Microsoft.WindowsTerminal_8wekyb3d8bbwe!App

And if you'd like to understand how I came up with the longer UWP-specific version of that, you can read more about that here.

How Can I Pass An Argument To the Target of the Shell Command?

If you want to pass command-line arguments to Windows Terminal, you can just add them to the end of the start command. For example, this opens a new tab with my GitBash terminal profile instead of the default:

> start "" shell:AppsFolder\Microsoft.WindowsTerminal_8wekyb3d8bbwe!App new-tab -p "GitBash"

And if you want to run that from SlickRun, which doesn't recognize the start command as a runnable file, you can use cmd /c, like this:

> cmd /c start "" shell:AppsFolder\Microsoft.WindowsTerminal_8wekyb3d8bbwe!App new-tab -p "GitBash"

comments powered by Disqus