Skip to content

Conversation

@aweis89
Copy link
Contributor

@aweis89 aweis89 commented Dec 20, 2025

Summary

Adds support for executing shell commands directly from the input window by prefixing them with !.

Changes

  • Shell command execution: Commands starting with ! are executed using vim.system() with the user's configured shell
  • Output display: Command output is shown in the output window with clear formatting
  • Context integration: Users are prompted to add command + output to the input context for LLM interaction
  • Error handling: Failed commands display error notifications with exit codes
  • UI updates: Input placeholder now shows ! shell hint

Behavior

  1. User types !<command> in input window
  2. Command executes asynchronously using user's shell (vim.o.shell)
  3. Output displays in output window: $ <command>\n<output>
  4. Prompt asks: "Add command + output to context?"
  5. If Yes: Appends formatted message to input buffer, clears output window, focuses input
  6. If No: Just focuses input window
  7. User can add additional context/prompt before submitting to LLM

Format

Command: `echo test`
Exit code: 0
Output:
\`\`\`
test output
\`\`\`

Testing

  • 5 comprehensive unit tests covering all scenarios
  • All existing tests still pass

Resolves #147

- Clear attachments when starting a new session with /new command
- Toggle file removal when selecting already-mentioned files with @ trigger
- Fixes issue where context persisted across new sessions
- Fixes issue where @ file selection only added files, never removed them
- enable executing shell commands prefixed with '!' in input window
- display command output in a dedicated output window
- prompt user to append command and output to input context
- handle command execution errors and notify user on failure
- touches(ui): update input window interactions and context management
- adjust confirmation dialog to clear the output window based on choice
- update unit tests to ensure desired behavior on user selection
- ensures consistent UI experience in input output handling
@sudo-tee
Copy link
Owner

This is great , thanks a lot for this

@sudo-tee sudo-tee merged commit fcc8666 into sudo-tee:main Dec 20, 2025
5 checks passed
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.

Enable bash commands from input window

2 participants