Repository navigation
Don't show the termination info bar for closeOnExit "always" - #21023
Draft
Kevin Wiblin (KevinWiblin) wants to merge 1 commit into
Draft
Kevin Wiblin (KevinWiblin) wants to merge 1 commit into
Kevin Wiblin (KevinWiblin) wants to merge 1 commit into
Conversation
When a profile with "closeOnExit": "always" exited with a nonzero code, the pane closed but the "Termination behavior can be configured in advanced profile settings" info bar still appeared. Skip it when the failed pane's profile already closes on exit. Closes microsoft#11608
Member
|
Honestly, we could skip showing the termination message for any profile which has configured CloseOnExit at all (in the user layers) because that suggests the user is at least passively aware of it |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of the Pull Request
When a profile has
closeOnExitset toalwaysand its command exits with a nonzero exit code, Terminal still displays the "Termination behavior can be configured in advanced profile settings" info bar.The pane closes as expected, but the info bar remains visible despite the user having already configured the termination behaviour.
This change prevents the info bar from being displayed for profiles with
closeOnExitset toalways.References and Relevant Issues
Closes #11608
Related to #11607, which concerns the info bar remaining visible after the pane that triggered it has been closed. That issue is outside the scope of this PR.
Detailed Description of the Pull Request / Additional comments
The change is limited to
TerminalPage::_ConnectionStateChangedHandlerinsrc/cascadia/TerminalApp/TerminalPage.cpp.The handler now uses the
TermControlthat raised the connection state event to locate the corresponding pane by walking the pane trees across all tabs.If the originating pane's profile has
CloseOnExit()set toCloseOnExitMode::Always, the handler returns without displaying the info bar.The control is obtained from
senderbefore theco_await, assenderis passed by reference and may no longer be valid when the coroutine resumes.The lookup returns a
Panerather than aProfile, sinceWalkTreereturnsR{}when no match is found. Returning aProfilewould construct a default profile rather than return null.The automatic mode behaviour for default terminal sessions introduced in #13325 is deliberately left unchanged. This PR is limited to the
alwayscase described in #11608.Validation Steps Performed
Built and deployed
CascadiaPackage(Debug x64) using unmodified main and the patched branch.Created test profiles using
cmd.exe /c exit 1, withcloseOnExitset toalwaysandgraceful.alwaystab closed but the termination info bar remained visible.alwaysprofile in a second tab. The tab closed without displaying the info bar, confirming that the lookup correctly skipped the unrelated first tab.gracefulprofile and confirmed that the info bar still appeared as expected.No automated regression tests have been added.
PR Checklist
"closeOnExit": "always"#11608