Pass commands to new wt instance. Is this already supported? #6453

Closed
opened 2026-01-31 00:39:06 +00:00 by claunia · 4 comments
Owner

Originally created by @ugreg on GitHub (Feb 15, 2020).

Description of the new feature/enhancement

Like how I can open a new command prompt with a command arg passed start cmd.exe /k echo Hello, World.

This does not work using Windows Terminal preview start C:\Users\me\AppData\Local\Microsoft\WindowsApps\Microsoft.WindowsTerminal_8wekyb3d8bbwe\wt /k Hello, World

Proposed technical implementation details (optional)

Implement this using cmd.exe like syntax.
start C:\Users\me\AppData\Local\Microsoft\WindowsApps\Microsoft.WindowsTerminal_8wekyb3d8bbwe\wt /k Hello, World.

or even better start wt /k Hello, World.

Originally created by @ugreg on GitHub (Feb 15, 2020). # Description of the new feature/enhancement Like how I can open a new command prompt with a command arg passed `start cmd.exe /k echo Hello, World`. This does not work using Windows Terminal preview `start C:\Users\me\AppData\Local\Microsoft\WindowsApps\Microsoft.WindowsTerminal_8wekyb3d8bbwe\wt /k Hello, World` # Proposed technical implementation details (optional) Implement this using `cmd.exe` like syntax. `start C:\Users\me\AppData\Local\Microsoft\WindowsApps\Microsoft.WindowsTerminal_8wekyb3d8bbwe\wt /k Hello, World`. or even better `start wt /k Hello, World`.
claunia added the Issue-QuestionNeeds-Tag-FixResolution-Answered labels 2026-01-31 00:39:06 +00:00
Author
Owner

@DHowett-MSFT commented on GitHub (Feb 15, 2020):

You can do wt cmd /k command if you want. Check out our docs folder for UsingCommandLineArgs.

@DHowett-MSFT commented on GitHub (Feb 15, 2020): You can do `wt cmd /k command` if you want. Check out our docs folder for UsingCommandLineArgs.
Author
Owner

@ugreg commented on GitHub (Feb 15, 2020):

Got it working thanks! I used this blog.

wt split-pane -p "Command Prompt" ; split-pane -p "Ubuntu" -d \\wsl$\Ubuntu\home\cinnak -H

terminal-command-args

@ugreg commented on GitHub (Feb 15, 2020): Got it working thanks! I used this [blog](https://devblogs.microsoft.com/commandline/windows-terminal-preview-v0-9-release/). `wt split-pane -p "Command Prompt" ; split-pane -p "Ubuntu" -d \\wsl$\Ubuntu\home\cinnak -H` ![terminal-command-args](https://user-images.githubusercontent.com/8151045/74591711-0f324a00-4fcf-11ea-8852-4b514d38f727.gif)
Author
Owner

@ugreg commented on GitHub (Feb 15, 2020):

@DHowett-MSFT is it possible to pass args to each split pane?

@ugreg commented on GitHub (Feb 15, 2020): @DHowett-MSFT is it possible to pass args to each split pane?
Author
Owner

@DHowett-MSFT commented on GitHub (Feb 15, 2020):

Yes.

wt cmd /k cd \ ; split-pane -H cmd /k dir ; split-pane powershell -noexit -c echo hi

@DHowett-MSFT commented on GitHub (Feb 15, 2020): Yes. `wt cmd /k cd \ ; split-pane -H cmd /k dir ; split-pane powershell -noexit -c echo hi`
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#6453