Repository navigation
Made -w 0 target the window of the calling terminal. - #20733
Open
Nathan Sweet (NathanSweet) wants to merge 1 commit into
Open
Nathan Sweet (NathanSweet) wants to merge 1 commit into
Nathan Sweet (NathanSweet) wants to merge 1 commit into
Conversation
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Author
|
@microsoft-github-policy-service agree |
1 of 4 tasks
Member
|
Of (EDIT to fix typo) the 7 PRs we got over the weekend, this is maybe the only one I don't viscerally hate. Thank you! We'll have a look. |
Author
|
Haha... wait, I opened 2 so that means you hate my other one! 😉 |
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.
wt -w 0now runs the commandline in the window thatwtwas run from, instead of the most recently used window. The calling terminal session is identified byWT_SESSIONin the caller's environment, as proposed in the Session Management spec. Ifwtwasn't run from a Terminal session (for example from Explorer or the Run dialog), or the session no longer exists, it falls back to the most recently used window as before.References
wt -w 0#10561, which Mike Griese (@zadjii-msft) repurposed to "Actually use the current window forwt -w 0".Details
WindowEmperor::_dispatchCommandlinefirst looks for the window hosting the caller's session, then falls back to the existing logic (_dispatchCommandlineCurrentDesktop/_mostRecentWindow).wt.exeis parsed withtil::env.TerminalPage::HostsSessionwalks the panes of all tabs and compares its connection'sSessionId(). The lookup happens at dispatch time, follows panes that were moved to another window.WindowingMode::UseExisting(-w 0,-w last, and"windowingBehavior": "useExisting") and toUseAnyExisting. In both cases the calling window is what "an existing window" should mean.WT_SESSIONcan only target an existing window, which-w <id>already allows.mainwith VS 2022 17.14 (v143) and SDK 10.0.26100.9169.