Skip to content

feat: add terminalAutoShow setting for auto-showing terminal on command execution#12278

Draft
roomote-v0[bot] wants to merge 1 commit intomainfrom
feature/terminal-auto-show
Draft

feat: add terminalAutoShow setting for auto-showing terminal on command execution#12278
roomote-v0[bot] wants to merge 1 commit intomainfrom
feature/terminal-auto-show

Conversation

@roomote-v0
Copy link
Copy Markdown
Contributor

@roomote-v0 roomote-v0 Bot commented May 6, 2026

Related GitHub Issue

Closes: #12277

Description

This PR attempts to address Issue #12277 by adding a new opt-in terminalAutoShow setting. Feedback and guidance are welcome.

Implementation (options a + c as approved by the reporter):

  • VS Code terminal mode (shell integration enabled): When terminalAutoShow is on, terminal.show(true) is called to reveal the terminal panel (preserving editor focus). When off, the terminal panel is no longer auto-shown.
  • Inline Terminal / execa mode: When terminalAutoShow is on, the command output in the chat is auto-expanded so users can always see command progress. This complements the existing behavior where execa output is already expanded by default.

Changes across the stack:

  1. packages/types/src/global-settings.ts -- Added terminalAutoShow to the zod schema with default false
  2. packages/types/src/vscode-extension-host.ts -- Added to ExtensionState pick type
  3. src/core/webview/ClineProvider.ts -- Thread setting through state retrieval
  4. src/core/tools/ExecuteCommandTool.ts -- Conditionally call terminal.show(true) only when enabled
  5. webview-ui/src/context/ExtensionStateContext.tsx -- Added state + setter
  6. webview-ui/src/components/settings/TerminalSettings.tsx -- Added checkbox in Basic settings
  7. webview-ui/src/components/settings/SettingsView.tsx -- Pass prop through
  8. webview-ui/src/components/chat/CommandExecution.tsx -- Auto-expand output when enabled
  9. webview-ui/src/i18n/locales/en/settings.json -- English i18n strings

Test Procedure

  • All existing tests pass (executeCommand, executeCommandTool, CommandExecution, SettingsView)
  • Manual testing: enable the setting in Terminal settings tab, run a command, and verify the terminal panel auto-shows (shell integration) or output auto-expands (inline terminal)

Pre-Submission Checklist

  • Issue Linked: This PR is linked to an approved GitHub Issue
  • Scope: Changes are focused on the linked issue
  • Self-Review: Performed self-review
  • Testing: Existing tests continue to pass; new setting follows existing patterns
  • Documentation Impact: Setting is self-documenting via the UI description
  • Contribution Guidelines: Read and agree

Documentation Updates

No external documentation changes needed -- the setting is described in the UI itself.

Interactively review PR in Roo Code Cloud

…nd execution

Adds a new opt-in setting "terminalAutoShow" that:
- When using VS Code terminal (shell integration enabled): automatically
  shows the terminal panel when Roo runs a command
- When using Inline Terminal (execa mode): auto-expands command output
  in the chat so users can always see what is happening

Addresses options (a) and (c) from Issue #12277.

Changes:
- packages/types: add terminalAutoShow to schema + ExtensionState
- src/core/tools/ExecuteCommandTool: conditionally call terminal.show()
- src/core/webview/ClineProvider: thread setting through state
- webview-ui: add checkbox in TerminalSettings, auto-expand in CommandExecution
- i18n: add English strings for the new setting
Copy link
Copy Markdown

@YousefBZo YousefBZo left a comment

Choose a reason for hiding this comment

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

I've reviewed all the changes in the PR, and I must say the implementation is perfect! You've addressed everything from the auto-focus in the VS Code terminal to the auto-expansion in the chat UI. The settings UI also looks very clean and the descriptions are clear. Thank you for making this happen—it's going to be a great addition to Roo Code!

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.

[ENHANCEMENT] Option to automatically show/focus terminal on command execution

2 participants