able to edit the terminal commands before executing

Problem

In agent window that generate and execute terminal commands are often run automatically without giving the user a chance to review or modify them.

What problem does this solve?

This addresses safety, accuracy, and user control issues. AI suggestions might not perfectly match the user’s environment, intent, or preferences, resulting in failed executions, wasted time regenerating commands, or manual workarounds like copying and pasting into a separate terminal.

Solution

Introduce a toggleable setting (e.g., in the app’s preferences or AI agent configuration) that, when enabled, pauses before executing any AI-generated terminal command and presents it in an editable interface for user review and modification.

How should it work?

  1. When the AI generates a terminal command (e.g., during an agent workflow), instead of auto-running it, display the command in a modal or inline editable text box.
  2. Include UI elements like:
    • An “Edit” mode where the user can modify the command directly.
    • Buttons for “Run” (execute the original or edited version), “Cancel” (skip the command), and “Regenerate” (ask AI to suggest an alternative).
    • Optional preview of the current working directory or environment variables for context.
  3. After user confirmation or edits, execute the command in the integrated terminal.
  4. Make this optional via a setting like “Require confirmation for AI terminal commands” to avoid disrupting power users who prefer automation.

Use Case

Imagine using an AI agent to set up a new React project. The AI suggests: git clone ``https://github.com/example/repo.git`` && cd repo && npm install. But the user wants to clone into a specific directory (e.g., add --depth=1 for a shallow clone) or skip the install if dependencies are already managed differently. With this feature, the user edits the command inline before running, preventing errors or redundant steps.

Priority

:yellow_circle: Medium - Important improvement