这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@var-aha
Copy link
Owner

@var-aha var-aha commented Oct 4, 2025

TLDR

Adds keyboard shortcuts (Meta+Enter on macOS, Ctrl+Enter on all platforms) to execute shell commands directly from the input prompt without entering shell mode.

Dive Deeper

Previously, users who wanted to run a shell command had to either:

  1. Toggle into shell mode with !, execute the command, then toggle back
  2. Use natural language to describe what command they want to run, which unnecessarily invokes the LLM (inefficient and slower)

This change adds a third option: pressing Meta+Enter (macOS) or Ctrl+Enter (all platforms) executes the current input text as a shell command without switching modes.

Implementation details:

  • Added EXECUTE_PROMPT_COMMAND to the command enum in key bindings
  • Configured key bindings for Meta+Enter (macOS) and Ctrl+Enter (all platforms)
  • Reuses existing handleShellCommand infrastructure from shell mode
  • Empty buffer handling prevents newline insertion
  • Commands support proper abort handling via AbortController
  • Updated help text to document the new shortcuts

Reviewer Test Plan

  1. Run the CLI with the changes
  2. Type a shell command in the prompt (e.g., ls -la)
  3. Press Meta+Enter (macOS) or Ctrl+Enter (other platforms)
    • Note for macOS testers: You can use Ctrl+Enter on macOS as well. If that doesn't work, try Option+Enter (since some terminals report Option as Meta instead of Cmd)
  4. Verify the command executes without entering shell mode
  5. Test with empty buffer to ensure no-op behavior
  6. Test command abortion with Ctrl+C

Testing Matrix

🍏 🪟 🐧
npm run
npx
Docker
Podman - -
Seatbelt - -

Linked issues / bugs

Fixes google-gemini#10130

@var-aha var-aha force-pushed the feature/quick-command-exec branch 4 times, most recently from cf739ea to dc7e123 Compare October 6, 2025 23:59
Add ability to execute shell commands directly from prompt mode using
Ctrl+Enter (or Meta+Enter on Mac) without switching to shell mode.

Updated documentation:
- Added keyboard shortcut reference
- Updated commands documentation with usage examples
- Updated help text with new shortcut
@var-aha var-aha force-pushed the feature/quick-command-exec branch from dc7e123 to 6237d36 Compare October 7, 2025 15:07
@var-aha var-aha marked this pull request as ready for review November 5, 2025 02:16
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.

Add a Direct Local Shell Execution Mode for Custom Commands