-
Couldn't load subscription status.
- Fork 35.8k
add terminal output dropdown, reveal command on focus #273175
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds terminal output dropdown functionality and implements command reveal on focus. It integrates terminal commands as attachments in chat, allowing users to attach terminal command output to chat conversations and navigate directly to commands in the terminal.
Key Changes:
- Added support for terminal command attachments in chat with associated UI widgets and hover previews
- Implemented command reveal functionality that scrolls to and highlights commands when terminal instances are focused
- Extended terminal URI handling to support command IDs for direct navigation to specific commands
Reviewed Changes
Copilot reviewed 27 out of 27 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
terminalCommand.ts |
Added unique ID and session tracking to terminal commands |
capabilities.ts |
Extended command interfaces with ID and chat session fields |
decorationAddon.ts |
Added "Attach To Chat" action for terminal commands |
xtermTerminal.ts |
Updated constructor to accept resource parameter for URI-based navigation |
terminalUri.ts |
Extended URI generation to include command IDs |
terminalService.ts |
Implemented openResource method to reveal commands in terminals |
chatVariableEntries.ts |
Added ITerminalVariableEntry type for terminal command attachments |
chatAttachmentWidgets.ts |
Implemented TerminalCommandAttachmentWidget for displaying terminal commands |
chatContext.ts |
Added TerminalContext class for terminal command context integration |
chatTerminalToolProgressPart.ts |
Added collapsible output preview with show/hide functionality |
| Test files | Updated test instantiations to match new constructor signatures |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
...ch/contrib/chat/browser/chatContentParts/toolInvocationParts/chatTerminalToolProgressPart.ts
Outdated
Show resolved
Hide resolved
src/vs/workbench/contrib/chat/browser/chatContentParts/media/chatTerminalToolProgressPart.css
Outdated
Show resolved
Hide resolved
| return; | ||
| } | ||
| const expanded = !this._outputContainer.classList.contains('expanded'); | ||
| this._outputContainer.classList.toggle('expanded', expanded); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Repro steps exactly? When I kill the associated terminal, both of those actions are removed for me
src/vs/workbench/contrib/chat/browser/chatContentParts/media/chatTerminalToolProgressPart.css
Outdated
Show resolved
Hide resolved
src/vs/workbench/contrib/chat/browser/chatContentParts/media/chatTerminalToolProgressPart.css
Outdated
Show resolved
Hide resolved
| if (result.truncated) { | ||
| const note = document.createElement('div'); | ||
| note.classList.add('chat-terminal-output-info'); | ||
| note.textContent = localize('chat.terminalOutputTruncated', 'Output truncated to first {0} characters.', MAX_TERMINAL_OUTPUT_PREVIEW_LENGTH); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
...ch/contrib/chat/browser/chatContentParts/toolInvocationParts/chatTerminalToolProgressPart.ts
Outdated
Show resolved
Hide resolved
...ch/contrib/chat/browser/chatContentParts/toolInvocationParts/chatTerminalToolProgressPart.ts
Outdated
Show resolved
Hide resolved
|
|
||
| private async _collectOutput(terminalInstance: ITerminalInstance): Promise<{ text: string; truncated: boolean }> { | ||
| this._attachedCommand ??= this._resolveCommand(terminalInstance); | ||
| let text = this._attachedCommand?.getOutput() ?? ''; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TerminalCommand knows about xterm and the markers, this should use getContentsAsHtml internally using that information



fixes #271387
fixes #271388
demo.mov