Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When a pane reports [process exited with code ...] the GUI should let you close it without closing the entire tab #11570

Closed
FabioTurati-NTT opened this issue Oct 21, 2021 · 2 comments · Fixed by #14060
Labels
Area-TerminalControl Issues pertaining to the terminal control (input, selection, keybindings, mouse interaction, etc.) Help Wanted We encourage anyone to jump in on these. Issue-Task It's a feature request, but it doesn't really need a major design. Product-Terminal The new Windows Terminal. Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release.
Milestone

Comments

@FabioTurati-NTT
Copy link

Description of the new feature/enhancement

When you use multiple panes in a single tab, and one of them exits with an error code, the pane is "stuck" displaying it. There are only 2 ways to dismiss the error message and close that pane:

  1. Closing the entire tab, which forces the user to also close the other panes. Reopening them can be long and boring (several SSH connections/ADB shells, scripts that must be sourced...)
  2. Using the keyboard shortcut Ctrl + Shift + W, which I can never remember

I have read in your FAQs why that message is kept, and I understand it, but this behaviour ("closeOnExit": "graceful") works fine only if you are using an entire tab, because you can easily close it by clicking on its X, but the GUI doesn't provide a way for closing a single pane.

Proposed technical implementation details (optional)

When the pane is "stuck" on the message displaying the error code, a graphical "X" should appear in its top-right corner. Clicking on it closes the pane.

@FabioTurati-NTT FabioTurati-NTT added the Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. label Oct 21, 2021
@ghost ghost added Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels Oct 21, 2021
@zadjii-msft
Copy link
Member

idea: TermControl could listen for the connection state to change and then send a bunch of newlines and then add a button to the TermControl underneath the message.

all the related discussions here:

@zadjii-msft zadjii-msft added Help Wanted We encourage anyone to jump in on these. Area-TerminalControl Issues pertaining to the terminal control (input, selection, keybindings, mouse interaction, etc.) Product-Terminal The new Windows Terminal. Issue-Task It's a feature request, but it doesn't really need a major design. and removed Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. labels Apr 22, 2022
@ghost ghost removed the Needs-Tag-Fix Doesn't match tag requirements label Apr 22, 2022
@zadjii-msft zadjii-msft added this to the Backlog milestone Apr 22, 2022
@zadjii-msft zadjii-msft removed the Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting label Apr 26, 2022
@ghost ghost added the In-PR This issue has a related PR label Sep 22, 2022
ghost pushed a commit that referenced this issue Dec 8, 2022
…terminal (#14060)

When a terminal process exits (successful or not) and the profile isn't
set to automatically close the pane, a new message is displayed:

You can now close this terminal with ^D or Enter to restart.

Ctrl+D then is able to close the pane and Enter restarts it.

I originally tried to do this at the ConptyConnection layer by changing
the connection state from Failed to Closed, but then that didn't work
for the case where the process exited successfully but the profile isn't
set to exit automatically. So, I added an event to
ControlCore/TermControl that Pane watches. ControlCore watches to see if
the input is Ctrl+D (0x4) and if the connection is closed or failed, and
then raises the event so that Pane can close itself. As it turned out, I
think this is the better place to have the logic to watch for the Ctrl+D
key. Doing it at the ConptyConnection layer meant I had to parse out the
key from the escaped text passed to ConptyConnection::WriteInput.

## Validation Steps Performed
Tried adding lots of panes and then killing the processes outside of
Terminal. Each showed the new message and I could close them with Ctrl+D
or restart them with Enter. Also set a profile to never close
automatically to make sure Ctrl+D would work when a process exits
successfully.

Closes #12849 
Closes #11570
Closes #4379
@ghost ghost closed this as completed in #14060 Dec 8, 2022
@ghost ghost added Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release. and removed In-PR This issue has a related PR labels Dec 8, 2022
@ghost
Copy link

ghost commented Jan 24, 2023

🎉This issue was addressed in #14060, which has now been successfully released as Windows Terminal Preview v1.17.1023.:tada:

Handy links:

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-TerminalControl Issues pertaining to the terminal control (input, selection, keybindings, mouse interaction, etc.) Help Wanted We encourage anyone to jump in on these. Issue-Task It's a feature request, but it doesn't really need a major design. Product-Terminal The new Windows Terminal. Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants