Terminal block hover overlay#17308
Open
Fangoling wants to merge 23 commits intoeclipse-theia:masterfrom
Open
Conversation
826e0ea to
db8eebc
Compare
3 tasks
Introduces an opt-in hover overlay (terminal.integrated.enableHoverActions, requires enableCommandHistory) that renders a context menu button when hovering over executed command blocks. Adds block-scoped commands for copying command, output, or both, and for scrolling to the top/bottom boundary of a block. Introduces TerminalBlockBoundary enum and abstract scrollToBlockBoundary API Signed-off-by: Fangxing Liu <[email protected]>
Adds an inline AI chat overlay triggered from the terminal block action menu, pre-filling the chat session with the selected command and its output as context. Registers the AskAITerminalInputWidget factory via a child DI container and cleans up the overlay when the terminal is disposed. Signed-off-by: Fangxing Liu <[email protected]>
missing on last commit Signed-off-by: Fangxing Liu <[email protected]>
Signed-off-by: Fangxing Liu <[email protected]>
Signed-off-by: Fangxing Liu <[email protected]>
…nd use onDidDispose for cleanup Signed-off-by: Fangxing Liu <[email protected]>
…get disposal Signed-off-by: Fangxing Liu <[email protected]>
…yController and fix disposal registration Signed-off-by: Fangxing Liu <[email protected]>
Signed-off-by: Fangxing Liu <[email protected]>
Signed-off-by: Fangxing Liu <[email protected]>
- scroll to bottom now correctly scrolls to the bottom of the block instead the start of the next block - extract the terminalBlockHoveraly as an interface - extract the add button code into a function Signed-off-by: Fangxing Liu <[email protected]>
Signed-off-by: Fangxing Liu <[email protected]>
977bc10 to
c97e8e5
Compare
Signed-off-by: Fangxing Liu <[email protected]>
Five terminal block commands (copy-all, copy-command, copy-output, scroll-to-top, scroll-to-bottom) were registered in registerMenus but missing from registerCommands after a rebase conflict, leaving them silently unresponsive. Also restores the TERMINAL_CONTRIBUTIONS context menu submenu registration and the TerminalBlock/TerminalBlockBoundary imports required by the command handlers. Signed-off-by: Fangxing Liu <[email protected]>
sdirix
requested changes
Apr 15, 2026
Member
sdirix
left a comment
There was a problem hiding this comment.
Generally it works for me.
The name "Enable Hover Actions" seems off as the ... button is always shown, not only on hover. So maybe it should be called "Enable Command Block Actions"? Or we should show the ... buttons only on hover, for now they are always shown for me.
When enabling the preference, the first ... button is only shown for the 2nd next block, not the next block. Can this be improved?
When disabling the preference and enabling it again, the ... buttons are not shown for blocks for which they were shown in the past. Can this be improved?
Signed-off-by: Fangxing Liu <[email protected]>
- rename hover actions to command block actions - rename ask ai to generate command via ai - rename ask ai about command to ask ai about this command - add missing localization key - use clipboardBoard service Signed-off-by: Fangxing Liu <[email protected]>
Signed-off-by: Fangxing Liu <[email protected]>
Signed-off-by: Fangxing Liu <[email protected]>
- controller was previously disposed on each preference trigger - controller is now only enabled/disabled - blocks tracked before this preference was disabled are still visible after enablement Signed-off-by: Fangxing Liu <[email protected]>
- terminal clear now adds a prompt start marker after clearing the terminal - first command after clearing is now tracked Signed-off-by: Fangxing Liu <[email protected]>
Signed-off-by: Fangxing Liu <[email protected]>
Signed-off-by: Fangxing Liu <[email protected]>
Signed-off-by: Fangxing Liu <[email protected]>
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.
What it does
Adds experimental terminal block hover actions on top of command history.
When
terminal.integrated.enableCommandHistoryand the newterminal.integrated.enableHoverActionspreference are enabled, executed command blocks get a hover affordance that opens a block action menu. The menu lets users copy the command, copy the output, copy both, and scroll to the top or bottom of the block.For AI-enabled setups, this also adds an
Ask AI about Commandaction for terminal blocks with command/output content. That action opens an inline Ask AI overlay in the terminal, submits the selected block context to a new chat session, and includes cleanup fixes for the overlay, widget disposal, and child DI container lifecycle.When #17312 is merged, we can also pass in the terminal AI Variable instead of the command content as plain text.
The implementation also places the hover overlay logic into a dedicated
TerminalBlockHoverOverlayControllerto keep marker tracking, viewport updates, and disposal isolated.The hover effect only appears when hovering over the ellipsis button at the far right of each command block, this is a limitation since the hover effect would conflict with the existing terminal hover links.
How to test
terminal.integrated.enableCommandHistoryterminal.integrated.enableHoverActionsecho hellolspwdCopy Command and Outputcopies both valuesCopy Commandcopies only the commandCopy Outputcopies only the outputScroll to Top of BlockandScroll to Bottom of Blockmove the viewport to the expected locationAsk AI about Commandappears for blocks that have command and output.Ask AI about Command, confirm the inline overlay appears in the terminal, submit a prompt, and verify a chat session opens with the terminal command/output prepended to the request.Follow-ups
Breaking changes
Attribution
Review checklist
nlsservice (for details, please see the Internationalization/Localization section in the Coding Guidelines)Reminder for reviewers