Allow no exit when the terminal is run with a commandline argument #8720

Open
opened 2026-01-31 01:36:21 +00:00 by claunia · 0 comments
Owner

Originally created by @mrahhal on GitHub (Jun 1, 2020).

Description of the new feature/enhancement

Assume we want to open a multi tab terminal in several directories, and we want to issue an initial command to be run in these directories. We could do the following:

wt -d "C:\directory1" dotnet restore `; -d "C:\directory2" dotnet run

When the command finishes, the terminal auto closes.
If we were to run a command like dotnet run, and then issue a Ctrl+C to the terminal, the terminal tells me the process exited and doesn't allow me to reuse the tab in the same directory.

image

I find this a very common pattern where we would have a script that opens a multi tab terminal, but sometimes I would want to stop and rerun one of the commands in one of the tabs, or simply want the tab to remain open in that directory. And in general, I find that this matches more closely to the behavior of the normal powershell/bash/etc terminals. Hitting Ctrl+C on a running app doesn't close the terminal itself, it simply returns command back to the user.

Proposed technical implementation details (optional)

I propose to add a new argument to the new-tab and split-pane commands, something like a --no-exit optional argument, which would allow the terminal tab to be reused after the initial command in the commandline finishes.

Originally created by @mrahhal on GitHub (Jun 1, 2020). <!-- 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 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). --> Assume we want to open a multi tab terminal in several directories, and we want to issue an initial command to be run in these directories. We could do the following: ``` wt -d "C:\directory1" dotnet restore `; -d "C:\directory2" dotnet run ``` When the command finishes, the terminal auto closes. If we were to run a command like `dotnet run`, and then issue a Ctrl+C to the terminal, the terminal tells me the process exited and doesn't allow me to reuse the tab in the same directory. ![image](https://user-images.githubusercontent.com/4404199/83383268-74c70c80-a3ed-11ea-8ad0-81025c60d8c2.png) I find this a very common pattern where we would have a script that opens a multi tab terminal, but sometimes I would want to stop and rerun one of the commands in one of the tabs, or simply want the tab to remain open in that directory. And in general, I find that this matches more closely to the behavior of the normal powershell/bash/etc terminals. Hitting Ctrl+C on a running app doesn't close the terminal itself, it simply returns command back to the user. # Proposed technical implementation details (optional) I propose to add a new argument to the `new-tab` and `split-pane` commands, something like a `--no-exit` optional argument, which would allow the terminal tab to be reused after the initial command in the `commandline` finishes.
claunia added the Issue-FeatureResolution-Duplicate labels 2026-01-31 01:36:22 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#8720