Overview
Theinteractive_bash tool provides tmux command execution for managing interactive terminal sessions. Use this for TUI applications (vim, htop, pudb) and REPL-based workflows that require ongoing interaction.
Source: src/tools/interactive-bash/
Important: Tmux only
This tool executes tmux commands only. It is NOT a general bash tool.- Pass tmux subcommands directly (without ‘tmux’ prefix)
- For one-shot commands, use the regular Bash tool instead
- For TUI apps needing ongoing interaction, use this tool
Parameters
The tmux subcommand to execute (without ‘tmux’ prefix)Examples:
"new-session -d -s omo-dev""send-keys -t omo-dev 'vim config.json' Enter""list-sessions""kill-session -t omo-dev"
tmux prefix. The tool adds it automatically.Response
Command output or errorSuccess:Error:Timeout:
Blocked commands
The following tmux commands are blocked and will return an error with instructions to use the Bash tool instead:capture-pane/capturepsave-buffer/savebshow-buffer/showbpipe-pane/pipep
Common patterns
Create and manage session
Send commands to session
Python REPL workflow
Debugger interaction (pudb)
TUI application (htop)
Special keys
Tmuxsend-keys supports special key names:
Enter- Send enter/return keyEscape- Send escape keySpace- Send spaceTab- Send tabBSpace- Send backspaceUp,Down,Left,Right- Arrow keysC-c- Send Ctrl+CC-d- Send Ctrl+DF1throughF12- Function keys
Timeout
Commands timeout after 60 seconds (60000ms). If a command exceeds this timeout:Quote handling
The tool includes a quote-aware tokenizer that properly handles:- Single quotes:
'vim file.txt' - Double quotes:
"echo 'hello'" - Escaped characters:
\"escaped quotes\" - Spaces in arguments:
'file with spaces.txt'
Error handling
Session not found
Invalid command
man tmux
Blocked command
Implementation details
Tmux path resolution
The tool automatically resolves the tmux binary path:- Checks cached path from background check
- Falls back to
tmuxin PATH
Process management
Commands are executed viaspawnWithWindowsHide to prevent console window flashing on Windows.
Stdout and stderr are captured in parallel to avoid race conditions.
Exit code handling
Non-zero exit codes are treated as errors:When to use
Useinteractive_bash for:
- TUI applications (vim, nano, htop, ncdu)
- Interactive debuggers (pudb, pdb)
- REPLs requiring multi-step interaction (python, node, irb)
- Long-running processes in tmux sessions
bash tool for:
- One-shot commands that complete immediately
- Capturing tmux session output
- Standard shell operations
- File operations, git commands, build tools