fix terminal output broken in collapsible mode#302634
Draft
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes terminal tool output not expanding/syncing correctly when rendered inside collapsible wrappers (thinking container and “simple terminal collapsible” mode), especially during restore when the command isn’t resolved yet.
Changes:
- Auto-expand stored output for completed invocations when using any collapsible wrapper mode (not just thinking container mode).
- When the terminal command becomes resolvable/detected later, sync the output expansion state with the wrapper’s expanded state.
Comments suppressed due to low confidence (2)
src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolProgressPart.ts:795
- This
_toggleOutput(true)call returns a Promise but the result isn't awaited/handled. Prefervoid this._toggleOutput(true);orawaitit to avoid floating Promises.
// Sync collapsible wrapper output now that the command is detected
if (this._usesCollapsibleWrapper && !this._outputView.isExpanded && this._thinkingCollapsibleWrapper?.expanded.get()) {
this._toggleOutput(true);
}
src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolProgressPart.ts:795
- Like the earlier sync in
tryResolveCommand, this re-expands output even if the user manually collapsed it (_userToggledOutput). Please gate this with_shouldAutoExpand()/!this._userToggledOutputso command-detection events don't override explicit user toggles.
// Sync collapsible wrapper output now that the command is detected
if (this._usesCollapsibleWrapper && !this._outputView.isExpanded && this._thinkingCollapsibleWrapper?.expanded.get()) {
this._toggleOutput(true);
}
You can also share your feedback on Copilot code review. Take the survey.
Comment on lines
+730
to
+731
| if (resolvedCommand && this._usesCollapsibleWrapper && !this._outputView.isExpanded && this._thinkingCollapsibleWrapper?.expanded.get()) { | ||
| this._toggleOutput(true); |
| this._addActions(terminalInstance, this._terminalData.terminalToolSessionId); | ||
| // In collapsible wrapper mode, sync output with the wrapper now that command | ||
| // is resolved. Deferred from construction because the command isn't available yet. | ||
| if (resolvedCommand && this._usesCollapsibleWrapper && !this._outputView.isExpanded && this._thinkingCollapsibleWrapper?.expanded.get()) { |
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
fix issue wehre the terminal piece was not expanding or connecting correctly