feat: Add terminal button for explain terminal context
Description
This update enhances the terminal integration with GitLab Duo Chat. The main changes include:
-
Improved terminal output explanation feature with a dedicated button in the terminal toolbar and keyboard shortcuts (Ctrl+Alt+T or Cmd+Alt+T on Mac).
-
Renamed the command from "Explain with Duo" to "Explain Terminal Output with Duo" and added an icon for better visibility.
-
Refactored the terminal context extraction logic to be more robust - now it can fall back to the last executed command if no text is selected, providing a better user experience.
-
Updated the UI presentation of terminal content in the chat interface, with clearer labeling that distinguishes between selected terminal text and last executed commands.
-
Improved error handling and clipboard management to ensure the user's clipboard content is properly preserved after the extension uses it to capture terminal text.
These changes make it easier for users to get AI-powered explanations of terminal output directly from their workflow, whether they've selected specific text or want to understand the results of their most recent command.
Related Issues
Resolves [VSCode] Add "explain terminal output" Code Lens (#1928 - closed)
How has this been tested?
-
If src/browserorsrc/commonhas been modified, please consider interoperability with the Web IDE. See Running the Extension in WebIDE. -
Consider an end-to-end test for significant new features that aren't covered by integration tests.
Screenshots (if appropriate)
Screen_Recording_2025-06-12_at_1.44.44_PM
What CHANGELOG entry will this MR create?
-
fix:Bug fix fixes - a user-facing issue in production - included in changelog -
feature:New feature - a user-facing change which adds functionality - included in changelog -
BREAKING CHANGE:(fix or feature that would cause existing functionality to change) - should bump major version, mentioned in the changelog -
None - other non-user-facing changes