Note: This is a question about Windows Terminal, a new command-line shell as of 2019, not Windows Command Prompt command line shell that is included with Windows.
If I am running cmd.exe in Windows Terminal, and I run start cmd
, it opens a new command prompt window outside of Windows Terminal.
Is there any way to set Windows Terminal to "intercept" or otherwise harness that command so that it instead opens in a new tab in Windows Terminal (obviously running cmd.exe
, in this example)?
Obviously, I can open a new tab with the mouse or a hotkey like Ctrl+Shift+2, but I'd like a way to do so from a batch file.
Best Answer
This is possible with Windows Terminal from version 0.9 onwards.
There are more examples on how to use this in the release notes of Windows Terminal 0.9: https://devblogs.microsoft.com/commandline/windows-terminal-preview-v0-9-release/