Skip to content

fix terminal output broken in collapsible mode#302634

Draft
justschen wants to merge 1 commit intomainfrom
justin/beartic
Draft

fix terminal output broken in collapsible mode#302634
justschen wants to merge 1 commit intomainfrom
justin/beartic

Conversation

@justschen
Copy link
Collaborator

fix issue wehre the terminal piece was not expanding or connecting correctly

Copilot AI review requested due to automatic review settings March 18, 2026 02:46
@vs-code-engineering vs-code-engineering bot added this to the 1.113.0 milestone Mar 18, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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. Prefer void this._toggleOutput(true); or await it 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._userToggledOutput so 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()) {
@justschen justschen marked this pull request as draft March 18, 2026 03:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants