Add command line option to windows terminal to open window and execute command #13375

Closed
opened 2026-01-31 03:41:06 +00:00 by claunia · 3 comments
Owner

Originally created by @jwlodek on GitHub (Apr 9, 2021).

Description of the new feature/enhancement

It would be nice to have an option to start a windows terminal from the command line and immediately run a command in it. I use this feature a lot in other terminals for example to open a new terminal directly into an ssh session.

Proposed technical implementation details (optional)

Something similar to the following would be good:

xfce4-terminal -x COMMAND
gnome-terminal -- COMMAND
start cmd.exe /C COMMAND
start powershell.exe /C COMMAND

example with cmd:

image

Originally created by @jwlodek on GitHub (Apr 9, 2021). # Description of the new feature/enhancement It would be nice to have an option to start a windows terminal from the command line and immediately run a command in it. I use this feature a lot in other terminals for example to open a new terminal directly into an ssh session. # Proposed technical implementation details (optional) Something similar to the following would be good: ``` xfce4-terminal -x COMMAND gnome-terminal -- COMMAND start cmd.exe /C COMMAND start powershell.exe /C COMMAND ``` example with cmd: ![image](https://user-images.githubusercontent.com/29227305/114117809-7b4bcd80-98b5-11eb-8891-2bb767a4d6d9.png)
Author
Owner

@jwlodek commented on GitHub (Apr 9, 2021):

Actually in cmd's case, the /K switch is more what I would like to see, but both /K and /C would be welcome

@jwlodek commented on GitHub (Apr 9, 2021): Actually in `cmd`'s case, the `/K` switch is more what I would like to see, but both `/K` and `/C` would be welcome
Author
Owner

@zadjii-msft commented on GitHub (Apr 9, 2021):

That's a great idea! Good thing we already implemented this!

https://docs.microsoft.com/en-us/windows/terminal/command-line-arguments?tabs=windows

You can use wt -- python.exe, or get more elaborate and do something like wt new-tab python.exe ; split-pane wsl.exe

@zadjii-msft commented on GitHub (Apr 9, 2021): That's a great idea! Good thing we already implemented this! https://docs.microsoft.com/en-us/windows/terminal/command-line-arguments?tabs=windows You can use `wt -- python.exe`, or get more elaborate and do something like `wt new-tab python.exe ; split-pane wsl.exe`
Author
Owner

@jwlodek commented on GitHub (Apr 9, 2021):

Oh wow awesome! It didn't show up in the /? popup for me which is why I asked, sorry for the clutter

@jwlodek commented on GitHub (Apr 9, 2021): Oh wow awesome! It didn't show up in the `/?` popup for me which is why I asked, sorry for the clutter
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#13375