Interactive Mode
Complete keyboard shortcuts, input modes, and interactive features reference for CodeBuddy Code interactive sessions.
Keyboard Shortcuts
NOTE
Keyboard shortcuts may vary by platform and terminal. Type a question mark `?` in an interactive session to see the shortcuts available in your environment.General Controls
| Shortcut | Description | Context | CodeBuddy Support |
|---|---|---|---|
Ctrl+C | Cancel current input or generation | Standard interrupt | ✅ Supported |
Ctrl+D | Exit CodeBuddy Code session | EOF signal | ✅ Supported |
Ctrl+L | Clear terminal screen | Preserves conversation history | ✅ Supported |
Ctrl+O | Toggle verbose output | Display detailed tool usage and execution information | ✅ Supported |
Ctrl+R | Reverse search command history | Interactive search of previous commands | ✅ Supported |
Ctrl+V (macOS/Linux) or Alt+V (Windows) | Paste image from clipboard | Paste image or image file path | ✅ Supported |
Up/Down Arrow Keys | Navigate command history | Recall previous inputs | ✅ Supported |
Esc + Esc | Rewind code/conversation | Restore code and/or conversation to previous state (requires pressing ESC twice consecutively when the input box is empty) | ✅ Supported |
Tab | Toggle thinking mode | Switch between thinking on and thinking off | ✅ Supported |
Shift+Tab or Alt+M (some configs) | Toggle permission mode | Switch between auto-accept, plan, and normal modes | ✅ Supported |
Notes:
Esc+Escrewind functionality is now supported: when the input box is empty, pressing the ESC key twice consecutively activates the/rewindfeature, allowing you to quickly revert code or conversation to a previous stateTabkey in CodeBuddy Code is primarily used for auto-completion, with partial support for thinking mode toggleShift+TabandAlt+M(Windows) are used to toggle permission modes, including normal mode, auto-accept edits mode, skip permissions mode, and plan mode
Multi-line Input
| Method | Shortcut | Context | CodeBuddy Support |
|---|---|---|---|
| Quick escape | \ + Enter | Works in all terminals | ✅ Supported |
| macOS default | Option+Enter | Default setting on macOS | ✅ Supported |
| Terminal setup | Shift+Enter | After executing /terminal-setup | ✅ Supported |
| Control sequence | Ctrl+J | Line feed character for multi-line | ✅ Supported |
| Paste mode | Direct paste | For code blocks, logs | ✅ Supported |
TIP
Configure your preferred line break behavior in terminal settings. Run `/terminal-setup` to install Shift+Enter bindings for iTerm2 and VS Code terminal.Quick Commands
| Shortcut | Description | Notes | CodeBuddy Support |
|---|---|---|---|
# at start | Memory shortcut - Add to CODEBUDDY.md | Prompts for file selection | ✅ Supported |
/ at start | Slash commands | See Slash Commands | ✅ Supported |
! at start | Bash mode | Run commands directly and add execution output to session | ✅ Supported |
@ | File path mention | Trigger file path auto-completion | ✅ Supported |
Editing Shortcuts
| Shortcut | Description | CodeBuddy Support |
|---|---|---|
Ctrl+A | Move to start of line | ✅ Supported |
Ctrl+E | Move to end of line | ✅ Supported |
Ctrl+K | Delete from cursor to end of line | ✅ Supported |
Ctrl+U | Delete from start of line to cursor | ✅ Supported |
Ctrl+W | Delete previous word | ✅ Supported |
Alt/Option+Backspace | Delete previous word | ✅ Supported |
Alt/Option+Delete | Delete next word | ✅ Supported |
Alt/Option+Left | Move to previous word | ✅ Supported |
Alt/Option+Right | Move to next word | ✅ Supported |
Ctrl+Left | Move to start of line | ✅ Supported |
Ctrl+Right | Move to end of line | ✅ Supported |
Ctrl+G | Open external editor to edit prompt | ✅ Supported |
Vim Editor Mode
Enable vim-style editing with the /vim command, or configure permanently via /config.
Mode Switching
| Command | Action | From Mode | CodeBuddy Support |
|---|---|---|---|
Esc | Enter NORMAL mode | INSERT | ✅ Supported |
i | Insert before cursor | NORMAL | ✅ Supported |
I | Insert at start of line | NORMAL | ✅ Supported |
a | Insert after cursor | NORMAL | ✅ Supported |
A | Insert at end of line | NORMAL | ✅ Supported |
o | Open new line below | NORMAL | ✅ Supported |
O | Open new line above | NORMAL | ✅ Supported |
Navigation (NORMAL Mode)
| Command | Action | CodeBuddy Support |
|---|---|---|
h/j/k/l | Move left/down/up/right | ✅ Supported |
w | Next word | ✅ Supported |
e | End of word | ✅ Supported |
b | Previous word | ✅ Supported |
0 | Start of line | ✅ Supported |
$ | End of line | ✅ Supported |
^ | First non-whitespace character | ✅ Supported |
gg | Start of input | ✅ Supported |
G | End of input | ✅ Supported |
Editing (NORMAL Mode)
| Command | Action | CodeBuddy Support |
|---|---|---|
x | Delete character | ✅ Supported |
dd | Delete line | ✅ Supported |
D | Delete to end of line | ✅ Supported |
dw/de/db | Delete word/to end/to start | ✅ Supported |
cc | Change line | ✅ Supported |
C | Change to end of line | ✅ Supported |
cw/ce/cb | Change word/to end/to start | ✅ Supported |
. | Repeat last change | ✅ Supported |
Command History
CodeBuddy Code maintains command history for the current session:
- History is stored by working directory
- Use
/clearto start a fresh conversation (old conversations can be resumed via/resume) - Navigate using Up/Down arrow keys (see keyboard shortcuts above)
- Note: History expansion (
!) is disabled by default
Reverse Search with Ctrl+R
Press Ctrl+R to interactively search your command history:
- Start search: Press
Ctrl+Rto activate reverse history search - Enter query: Type text to search in previous commands - search terms will be highlighted in matching results
- Navigate matches: Press
Ctrl+Ragain to cycle through earlier matches - Accept match:
- Press
TaborEscto accept the current match and continue editing - Press
Enterto accept and execute the command immediately
- Press
- Cancel search:
- Press
Ctrl+Cto cancel and restore original input - Press
Backspaceon empty search to cancel
- Press
The search displays matching commands and highlights search terms, making it easy to find and reuse previous inputs.
Background Bash Commands
CodeBuddy Code supports running bash commands in the background, allowing you to continue working while long-running processes execute.
How Background Execution Works
When CodeBuddy Code runs a command in the background, it runs the command asynchronously and immediately returns a background task ID. CodeBuddy Code can respond to new prompts while the command continues to execute in the background.
To run a command in the background, you can:
- Prompt CodeBuddy Code to run the command in the background
- Press
Ctrl+Bto move a regular Bash tool call to the background. (Tmux users must pressCtrl+Btwice due to tmux's prefix key.)
Key features:
- Output is buffered and CodeBuddy can retrieve it using the BashOutput tool
- Background tasks have unique IDs for tracking and output retrieval
- Background tasks are automatically cleaned up when CodeBuddy Code exits
Common background commands:
- Build tools (webpack, vite, make)
- Package managers (npm, yarn, pnpm)
- Test runners (jest, pytest)
- Development servers
- Long-running processes (docker, terraform)
Bash Mode with ! Prefix
Run bash commands directly by prefixing your input with !, without going through CodeBuddy:
bash
! npm test
! git status
! ls -laBash mode:
- Adds commands and their output to the conversation context
- Displays live progress and output
- Supports the same
Ctrl+Bfor running long-running commands in the background - Doesn't require CodeBuddy to interpret or approve commands
This is useful for quick shell operations while maintaining conversation context.
Permission Modes
CodeBuddy Code supports multiple permission modes to control how tool usage is authorized:
Available Modes
| Mode | Description | Toggle Shortcut |
|---|---|---|
| Normal Mode (Default) | Asks for confirmation of tool usage based on permission rules | Shift+Tab/Alt+M |
| Auto-Accept Edits Mode | Automatically approves file editing operations (Edit/Write), other tools still require confirmation | Shift+Tab/Alt+M |
| Skip Permissions Mode | Bypasses all permission checks. Recommended for use only in sandboxes without internet access | Shift+Tab/Alt+M |
| Plan Mode | AI will formulate a plan and wait for approval before execution | Shift+Tab/Alt+M |
Toggling Permission Modes
- Use
Shift+Tab(most terminals) orAlt+M(Windows) to cycle through modes - Specify startup mode using the
--permission-modecommand line argument:bashcodebuddy --permission-mode acceptEdits codebuddy --permission-mode bypassPermissions codebuddy --permission-mode plan - Set default mode in
settings.json:json{ "permissions": { "defaultMode": "acceptEdits" } }
Permission Rules
Permission modes work in conjunction with permission rules to provide fine-grained control. See the IAM documentation for details on configuring permission rules.
Related Documentation
- Slash Commands - Interactive session commands
- CLI Reference - Command line flags and options
- Settings Configuration - Configuration options
- Memory Management - Managing CODEBUDDY.md files
- IAM Permissions - Tool permissions and access control
- Bash Sandboxing - Bash command sandboxing mode
Tip: Type
?at any time in an interactive session to see available shortcuts and commands. Use the/helpcommand for more help information.