-
Notifications
You must be signed in to change notification settings - Fork 8.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
When the terminal has exited, ctrl+D to close pane, Enter to restart …
…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
- Loading branch information
Showing
12 changed files
with
106 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters