Fix performance problems with terminal tabs#285039
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes performance issues in the terminal tabs feature, specifically addressing slow typing in the terminal caused by getContainerWidthCachedForTask being called frequently during text rendering. The changes optimize layout calculations and eliminate forced reflows by moving width checks to the layout cycle and replacing dynamic CSS calculations with static values.
Key Changes:
- Refactored terminal tabs width calculation from per-render to layout-based caching
- Added debouncing (500ms) to shell integration status refresh to avoid impacting typing latency
- Replaced dynamic CSS margin calculation with static value in terminal command guide
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
markNavigationAddon.ts |
Removes dynamic getComputedStyle() call for marginLeft calculation that was causing forced layout |
terminalTooltip.ts |
Removes refreshShellIntegrationInfoStatus function (moved to terminalInstance.ts) and cleans up unused imports |
terminalTabsList.ts |
Refactors width-based visibility checks to use layout-driven state (hasText, hasActionBar) instead of checking container width on every render |
terminalInstance.ts |
Moves refreshShellIntegrationInfoStatus as a private debounced method to prevent it from impacting input latency during typing |
terminal.css |
Adds static margin-left: -20px to replace the removed dynamic calculation |
lszomoru
approved these changes
Dec 25, 2025
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Fixes #285031
Merge first:
cc @meganrogge