Enable sending input to terminal instance by wt.exe #17269

Closed
opened 2026-01-31 05:37:21 +00:00 by claunia · 4 comments
Owner

Originally created by @ZhiruiLi on GitHub (Apr 18, 2022).

Description of the new feature/enhancement

Some times we need to control windows terminal through command line. For example: switch dir to a given path. Now the only way to do that is to open a new pane or tab through wt.exe. However, open a new pane or tab is very slow when using powershell, it will be faster if we can just send input to a existing terminal, like:

wt.exe -w 0 -S "cd ~/project/MyProj; git pull"

Proposed technical implementation details (optional)

Originally created by @ZhiruiLi on GitHub (Apr 18, 2022). <!-- 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 I ACKNOWLEDGE THE FOLLOWING BEFORE PROCEEDING: 1. If I delete this entire template and go my own path, the core team may close my issue without further explanation or engagement. 2. If I list multiple bugs/concerns in this one issue, the core team may close my issue without further explanation or engagement. 3. If I write an issue that has many duplicates, the core team may close my issue without further explanation or engagement (and without necessarily spending time to find the exact duplicate ID number). 4. If I leave the title incomplete when filing the issue, the core team may close my issue without further explanation or engagement. 5. If I file something completely blank in the body, the core team may close my issue without further explanation or engagement. All good? Then proceed! --> # Description of the new feature/enhancement <!-- A clear and concise description of what the problem is that the new feature would solve. Describe why and how a user would use this new functionality (if applicable). --> Some times we need to control windows terminal through command line. For example: switch dir to a given path. Now the only way to do that is to open a new pane or tab through `wt.exe`. However, open a new pane or tab is very slow when using powershell, it will be faster if we can just send input to a existing terminal, like: ```bash wt.exe -w 0 -S "cd ~/project/MyProj; git pull" ``` # Proposed technical implementation details (optional) <!-- A clear and concise description of what you want to happen. -->
claunia added the Issue-FeatureResolution-Duplicate labels 2026-01-31 05:37:21 +00:00
Author
Owner

@zadjii-msft commented on GitHub (Apr 18, 2022):

Okay this might seem silly, but wt -w 0 send-input {whatever} seems a lot harder than just typing {whatever} at the commandline in the current window, right?

This sounds a lot like #9368, but I might need more context on your actual use case here

@zadjii-msft commented on GitHub (Apr 18, 2022): Okay this might seem silly, but `wt -w 0 send-input {whatever}` seems a lot harder than just typing `{whatever}` at the commandline in the current window, right? This sounds a lot like #9368, but I might need more context on your actual use case here
Author
Owner

@ZhiruiLi commented on GitHub (Apr 19, 2022):

Okay this might seem silly, but wt -w 0 send-input {whatever} seems a lot harder than just typing {whatever} at the commandline in the current window, right?

This sounds a lot like #9368, but I might need more context on your actual use case here

There are many case that we can't type in current window, for example: implementing a plugin in vscode to let current terminal cd to current file location. Or we can trigger commands execution from some launcher apps, and see result in current terminal. It's too heavy for these use cases to start new wnidows terminal instances, reuse existing instances will be much better.

@ZhiruiLi commented on GitHub (Apr 19, 2022): > Okay this might seem silly, but `wt -w 0 send-input {whatever}` seems a lot harder than just typing `{whatever}` at the commandline in the current window, right? > > > > This sounds a lot like #9368, but I might need more context on your actual use case here There are many case that we can't type in current window, for example: implementing a plugin in vscode to let current terminal cd to current file location. Or we can trigger commands execution from some launcher apps, and see result in current terminal. It's too heavy for these use cases to start new wnidows terminal instances, reuse existing instances will be much better.
Author
Owner

@zadjii-msft commented on GitHub (Apr 19, 2022):

Okay yea that's on me. Must not have had enough coffee - I read "commandline" and automatically assumed you were already sitting at the Terminal window and wanted to run that commandline in the Terminal window 😝

/dup #9368

@zadjii-msft commented on GitHub (Apr 19, 2022): Okay yea that's on me. Must not have had enough coffee - I read "commandline" and automatically assumed you were already sitting at the Terminal window and wanted to run that commandline _in the Terminal window_ 😝 /dup #9368
Author
Owner

@ghost commented on GitHub (Apr 19, 2022):

Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!

@ghost commented on GitHub (Apr 19, 2022): Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#17269