get hidden chat terminal count to update #276163
Merged
meganrogge merged 8 commits intomainfrom Nov 7, 2025
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This pull request refactors the logic for handling hidden chat terminals by centralizing the filtering logic within getToolSessionTerminalInstances(). The main goal is to improve code maintainability by eliminating duplicate logic for determining which chat terminals are hidden.
- Added an optional
hiddenOnlyparameter togetToolSessionTerminalInstances()to filter for hidden terminals - Refactored callers to use the new parameter instead of duplicating filtering logic
- Fixed a menu visibility condition to use the correct context key
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatService.ts | Added hiddenOnly parameter to getToolSessionTerminalInstances() and refactored _updateHasToolTerminalContextKeys() to use it |
| src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatActions.ts | Fixed menu visibility condition to use hasHiddenChatTerminals instead of hasChatTerminals |
| src/vs/workbench/contrib/terminal/browser/terminalTabsChatEntry.ts | Refactored to use new hiddenOnly parameter and replaced context key service with terminal service |
| src/vs/workbench/contrib/terminal/browser/terminalTabbedView.ts | Separated event listeners and updated to use hiddenOnly parameter for determining tab visibility |
| src/vs/workbench/contrib/terminal/browser/terminalService.ts | Added onDidChangeInstances event firing when creating instances |
| src/vs/workbench/contrib/terminal/browser/terminal.ts | Updated interface documentation to reflect new hiddenOnly parameter |
Comments suppressed due to low confidence (1)
src/vs/workbench/contrib/terminal/browser/terminalTabbedView.ts:153
- Both event handlers execute identical code. Consider using
Event.any()to combine these two event listeners into a single handler to reduce code duplication:this._register(Event.any(this._terminalChatService.onDidRegisterTerminalInstanceWithToolSession, this._terminalService.onDidChangeInstances)(() => { this._refreshShowTabs(); this._updateChatTerminalsEntry(); }));
this._register(Event.any(this._terminalChatService.onDidRegisterTerminalInstanceWithToolSession, this._terminalService.onDidChangeInstances)(() => {
this._refreshShowTabs();
this._updateChatTerminalsEntry();
}));
this._register(contextKeyService.onDidChangeContext(e => {
if (e.affectsSome(new Set(['hasHiddenChatTerminals']))) {
this._refreshShowTabs();
src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatService.ts
Show resolved
Hide resolved
Tyriar
approved these changes
Nov 7, 2025
meganrogge
added a commit
that referenced
this pull request
Nov 7, 2025
meganrogge
added a commit
that referenced
this pull request
Nov 7, 2025
get hidden chat terminal count to update (#276163)
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.
address #275789 in main
This specifically fixes the background terminal case, where
onDidChangeInstanceswas not firing, so the entry would not get updated.Also, the
terminalTabbedViewwas not updated to only considerhiddeninstances.