microsoft / microsoft/terminal

Restoring persisted session with custom tab colors/titles causes sequential visual focus jumping (macro-like execution)

Open
#19,970 1 comment 0 reactions 1 assignee Claimed by @DHowett View on GitHub
Area-Settings Impact-Correctness Issue-Bug Product-Terminal
Dominant language
C++
Stars
105k
Forks
9.6k
Avg merge
3d 17h
Merged PRs (30d)
29

Description

### Windows Terminal version

1.23.20211.0

### Windows build number

10.0.22631.0

### Other Software

_No response_

### Steps to reproduce

1. Set `"firstWindowPreference": "persistedWindowLayout"` in `settings.json`.
2. Open 4 PowerShell tabs.
3. Right-click on two of the tabs and manually set a Custom Title and a Custom Color.
4. Close Windows Terminal to save the state.
5. Reopen Windows Terminal.

### Expected Behavior

Windows Terminal should restore the session and apply the custom colors and titles to the background tabs silently, without sequentially shifting the visual focus (`focusPane`) to each tab during the startup process.

### Actual Behavior

When restoring a persisted session (`"firstWindowPreference": "persistedWindowLayout"`) that contains tabs with manually modified titles or colors, Windows Terminal does not restore the background tabs silently. Instead, it visually jumps and shifts focus through each tab one by one.

This happens because the `state.json` file records these manual customizations as a sequence of discrete actions (`newTab`, `setTabColor`, `renameTab`, and explicitly `focusPane`). During startup, Windows Terminal executes this sequence like a macro, forcefully shifting the visual focus to each tab as it applies the custom title/color.

Because my underlying shell (PowerShell + Oh-My-Posh) currently takes over 1000ms to load per tab, this macro execution becomes painfully visible. The user experiences a jarring, sequential flickering and jumping of the UI from tab to tab for several seconds until the final active tab is reached.

https://github.com/user-attachments/assets/70fd9a0f-9e99-43d2-9a35-4dd1a7d90370

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.