Repository navigation
Add support for the XTWINOPS 22/23 title stack - #21015
Open
Darrell Chee (darrellchee) wants to merge 2 commits into
Open
Darrell Chee (darrellchee) wants to merge 2 commits into
Darrell Chee (darrellchee) wants to merge 2 commits into
Conversation
CSI 22 ; Ps t saves the current window title on a stack and CSI 23 ; Ps t restores it. Ps 0, 1, 2 and omitted all act on the one title we have, since OSC 0, 1 and 2 all set it. The stack keeps at most 10 entries, like the XTPUSHSGR stack. The adapter reads the title through a new ITerminalApi::GetWindowTitle, so titles set through the console API or the profile are saved too. Closes microsoft#14575
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
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
Adds xterm's title stack:
CSI 22 ; Ps tsaves the current window title andCSI 23 ; Ps trestores it. Ps 0, 1, 2 and omitted all act on our single title, since OSC 0, 1 and 2 all set it. Other values are ignored. The stack keeps at most 10 entries and drops the oldest, like the XTPUSHSGR stack.References and Relevant Issues
Closes #14575
Detailed Description of the Pull Request / Additional comments
WindowManipulationTypevaluesPushWindowTitle = 22andPopWindowTitle = 23, handled inAdaptDispatch::WindowManipulation.ITerminalApi::GetWindowTitle(), so the adapter saves the real current title, including one set throughSetConsoleTitle. In Terminal it returns only the app-set title, so popping back to "no app title" restores the profile's starting title.AdaptDispatch, like_sgrStack. So buffers made byCreateConsoleScreenBuffereach have their own stack. The alt buffer shares the main one.Validation Steps Performed
AdapterTest::WindowTitleStackTest,AdapterTest::WindowTitleStackLimitTest,TerminalApiTest::WindowTitleStack,ScreenBufferTests::WindowTitleStack. They fail without the change and pass with it.PR Checklist