Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions src/cascadia/TerminalApp/TerminalPage.Protocol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -728,6 +728,21 @@ namespace winrt::TerminalApp::implementation
if (!paneId)
co_return false;

// Bring this window to the foreground. `focus_pane` can target a
// pane that lives in a *different* window than the one driving the
// request (e.g. Enter on a session in window B whose pane lives in
// window A). The `_SetFocusedTab` / `FocusPane` calls below only
// move XAML focus *within* this window — they don't activate the OS
// window, and when the target pane is already the focused pane here
// they no-op entirely. Without an explicit summon the window would
// then stay in the background whenever it happened to already have
// the target pane focused, while working only when focus actually
// transitioned (an accidental side effect). Raising
// `SummonWindowRequested` mirrors the desktop-notification
// activation path (TabManagement.cpp) and makes `focus_pane`
// reliably surface the window regardless of its prior focus state.
SummonWindowRequested.raise(nullptr, nullptr);

_SetFocusedTab(tab);

// The pane may be a currently-stashed agent pane (Ctrl+Shift+. /
Expand Down
Loading