Ability to create new tabs / panes from scripts in current session #12146

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

Originally created by @g0blue on GitHub (Jan 22, 2021).

Script support for new tabs and panes in current session

I would like the ability to add tabs and panes to the current terminal window from a script. I would imagine it would look something like:

wt.exe --session %WT_SESSION% split-pane -p %WT_PROFILE_ID% [cmd [cmd_args]]

Given the security issues involved, I would also imagine that there would be a global setting to enable this functionality (that defaults to disabled). It would be ideal if the script could query (through environment variables or some command) if the functionality is enabled, but it may also suffice if the wt.exe command failed with a specific (non-common) result value if the feature is disabled.

Background

This is for debugging multi-process workloads where the child-processes are spawned automatically from a master process. Having everything in the same window / tab makes debugging much easier. :) It would be even better if we could have windows terminal panes in Visual Studio or Visual Studio Code integrated terminals.

Proposed technical implementation details (optional)

Originally created by @g0blue on GitHub (Jan 22, 2021). <!-- 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 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! --> # Script support for new tabs and panes in current session <!-- 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). --> I would like the ability to add tabs and panes to the current terminal window from a script. I would imagine it would look something like: ``` wt.exe --session %WT_SESSION% split-pane -p %WT_PROFILE_ID% [cmd [cmd_args]] ``` Given the security issues involved, I would also imagine that there would be a global setting to enable this functionality (that defaults to `disabled`). It would be ideal if the script could query (through environment variables or some command) if the functionality is enabled, but it may also suffice if the wt.exe command failed with a specific (non-common) result value if the feature is disabled. ## Background This is for debugging multi-process workloads where the child-processes are spawned automatically from a master process. Having everything in the same window / tab makes debugging much easier. :) It would be even better if we could have windows terminal panes in Visual Studio or Visual Studio Code integrated terminals. # Proposed technical implementation details (optional) <!-- A clear and concise description of what you want to happen. -->
claunia added the Issue-FeatureNeeds-TriageNeeds-Tag-Fix labels 2026-01-31 03:07:24 +00:00
Author
Owner

@g0blue commented on GitHub (Jan 22, 2021):

I've also filed a feature request for adding a --wait parameter with #8856.

Ideally, I would like to combine that feature with this so I could fork a thread, launch a process in a new pane and wait for it to finish (or kill it programmatically).

@g0blue commented on GitHub (Jan 22, 2021): I've also filed a feature request for adding a `--wait` parameter with #8856. Ideally, I would like to combine that feature with this so I could fork a thread, launch a process in a new pane and wait for it to finish (or kill it programmatically).
Author
Owner

@j4james commented on GitHub (Jan 23, 2021):

I think this feature is covered by issue #4472.

@j4james commented on GitHub (Jan 23, 2021): I think this feature is covered by issue #4472.
Author
Owner

@g0blue commented on GitHub (Jan 23, 2021):

Agreed, my apologies. Duplicate of #4472.

@g0blue commented on GitHub (Jan 23, 2021): Agreed, my apologies. Duplicate of #4472.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#12146