[PR #17268] Fix persistence of handoff'd tabs #31175

Open
opened 2026-01-31 09:45:35 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/microsoft/terminal/pull/17268

State: closed
Merged: Yes


As it turns out, for handoff'd connections Initialize isn't called
and this meant the _sessionId was always null.
After this PR we still don't have a _profileGuid but that's probably
not a critical issue, since that's an inherent flaw with handoff.
It can only be solved in a robust manner if WT gets launched before the
console app is launched, but it's unlikely for that to ever happen.

Validation Steps Performed

  • Launch
  • Register that version of WT as the default
  • Close all tabs (Ctrl+Shift+W)
  • persistedWindowLayouts is empty
  • Launch cmd/pwsh via handoff
  • You get 1 window
  • Close the window (= press the X button)
  • Launch
  • You get 2 windows
**Original Pull Request:** https://github.com/microsoft/terminal/pull/17268 **State:** closed **Merged:** Yes --- As it turns out, for handoff'd connections `Initialize` isn't called and this meant the `_sessionId` was always null. After this PR we still don't have a `_profileGuid` but that's probably not a critical issue, since that's an inherent flaw with handoff. It can only be solved in a robust manner if WT gets launched before the console app is launched, but it's unlikely for that to ever happen. ## Validation Steps Performed * Launch * Register that version of WT as the default * Close all tabs (Ctrl+Shift+W) * `persistedWindowLayouts` is empty ✅ * Launch cmd/pwsh via handoff * You get 1 window ✅ * Close the window (= press the X button) * Launch * You get 2 windows ✅
claunia added the pull-request label 2026-01-31 09:45:35 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#31175