tencent cloud

Interactive Mode

Download
Focus Mode
Font Size
Last updated: 2026-09-30 18:15:48
AI-Translated
A complete reference for keyboard shortcuts, input modes, and interactive features in CodeBuddy Code interactive sessions.

Keyboard Shortcuts

Keyboard shortcuts may vary by platform and terminal. Type a question mark ? in an interactive session to view the shortcuts available in your environment.

General Controls

Shortcut Keys
Description
Context
CodeBuddy Support
Ctrl+C
Cancel current input or generation.
Standard interrupt
Supported
Ctrl+D
Exit the CodeBuddy Code session (when the input box is empty and no conversation is in progress).
EOF signal, press twice to exit.
Supported
Ctrl+L
Clear the terminal screen.
Preserve conversation history.
Supported
Ctrl+O
Toggle detailed output.
Display detailed tool usage and execution information.
Supported
Ctrl+R
Reverse search command history.
Interactively search previous commands.
Supported
Ctrl+V (macOS/Linux) or Alt+V (Windows)
Paste text or images from the clipboard. On Windows, use Alt+V for a more stable experience when pasting large blocks of text.
Paste text, images, or image file paths.
Supported
Up/Down arrow keys
Navigate command history.
Recall previous input. When queued messages exist, Up prioritizes pulling queued messages back to the input box for editing.
Supported
Esc + Esc
Revert code/conversation.
Restore code and/or conversation to a previous state (press twice consecutively when the input box is empty).
Supported
Tab
Toggle thinking mode.
Toggle between thinking enabled and thinking disabled.
Supported
Shift+Tab (all platforms; Windows also supports Alt+M)
Toggle permission mode.
Cycle through default, bypassPermissions, acceptEdits, auto (when available), plan, and delegate
Supported
Option+P (macOS) or Alt+P (Windows/Linux)
Switch model.
Quickly open the model selection panel.
Supported
Note:
The Esc + Esc rewind feature is now supported: when the input box is empty, pressing ESC twice consecutively activates the /rewind feature to quickly revert code or conversations to a previous state.
The Tab key is primarily used for autocompletion in CodeBuddy Code, and the switching feature for extended thinking mode is partially supported.
Shift+Tab is used to switch permission modes (available on all platforms, with Alt+M supported as an alias on Windows). The current cycle order is: default → bypassPermissions → acceptEdits → auto (when available) → plan → delegate. dontAsk is not in the keyboard cycle and must be entered through --permission-mode dontAsk or settings. You can customize it through ~/.codebuddy/keybindings.json.

Multiline Input

Methodology
Shortcut Keys
Context
CodeBuddy Support
Quick escape
\\ + Enter
Works in all terminals.
Supported
macOS default
Option+Enter
Default setting on macOS
Supported
Terminal settings
Shift+Enter
After running /terminal-setup
Supported
Control sequence
Ctrl+J
Line break character for multiple lines
Supported
Paste mode
Paste directly
For code blocks and logs
Supported
Note:
Configure your preferred line-wrapping behavior in the terminal settings. Run `/terminal-setup` to install the Shift + Enter binding for iTerm2 and VS Code terminals.

Quick Commands

Shortcut Keys
Description
Annotation
CodeBuddy Support
# at the beginning
Memory shortcut - add to CODEBUDDY.md
Prompts to select a file
Supported
/ at the beginning
Slash commands
Supported
! at the beginning
Bash mode
Run commands directly and add execution output to the session.
Supported
@
File path mention
Trigger automatic file path completion.
Supported

Editing Shortcuts

Shortcut Keys
Description
CodeBuddy Support
Ctrl+A
Move to the beginning of the line.
Supported
Ctrl+E
Move to the end of the line.
Supported
Ctrl+K
Delete from cursor to end of line.
Supported
Ctrl+U
Delete from beginning of line to cursor.
Supported
Ctrl+W
Delete the previous word.
Supported
Ctrl+Y
Copy the last AI reply to the clipboard.
Supported
Alt/Option+Backspace
Delete the previous word.
Supported
Alt/Option+Delete
Delete the next word.
Supported
Alt/Option+Left
Move to the previous word.
Supported
Alt/Option+Right
Move to the next word.
Supported
Ctrl+Left
Move to the beginning of the line.
Supported
Ctrl+Right
Move to the end of the line.
Supported
Ctrl+G
Open an external editor to edit the prompt.
Supported

Vim Editor Modes

Use the /vim command to enable vim-style editing, or configure it permanently through /config.

Mode Switching

Command
Operation
From Mode
CodeBuddy Support
Esc
Go to NORMAL mode.
INSERT
Supported
i
Insert before cursor.
NORMAL
Supported
I
Insert at line start.
NORMAL
Supported
a
Insert after cursor.
NORMAL
Supported
A
Insert at line end.
NORMAL
Supported
o
Open a new line below.
NORMAL
Supported
O
Open a new line above.
NORMAL
Supported

Navigation (NORMAL Mode)

Command
Operation
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
Beginning of line
Supported
$
End of line
Supported
^
First non-blank character
Supported
gg
Beginning of input
Supported
G
End of input
Supported

Editing (NORMAL Mode)

Command
Operation
CodeBuddy Support
x
Delete the character.
Supported
dd
Delete the row.
Supported
D
Delete to end of line.
Supported
dw/de/db
Delete word/to end/to beginning.
Supported
cc
Modify the line.
Supported
C
Modify to end of line.
Supported
cw/ce/cb
Modify word/to end/to beginning.
Supported
.
Repeat last modification.
Supported

Command History

CodeBuddy Code maintains command history for the current session:
History is stored by working directory.
Use /clear to start a new conversation (previous conversations can be resumed through /resume).
Use the Up/Down arrow keys to navigate (see the keyboard shortcuts above).
Note: History expansion (!) is disabled by default.

Editing Queued Messages

When the Agent is responding, messages that you enter and submit are queued and displayed above the input box. The input box is empty at this point. Press the Up arrow key to pull the queued messages back into the input box for further editing (multiple queued messages are merged in the order they were sent, joined by line breaks):
When the input box is empty and there are editable queued messages, a "Press ↑ to edit queued messages" prompt is displayed.
Queued items injected by the system (such as async task notifications, channel messages, and teammate messages) are not pulled back into the input box. They remain in the queue and continue to be processed automatically.
When you are already navigating history with the Up/Down keys, the arrow keys continue to be processed as history navigation and are not interrupted.

Using Ctrl+R for Reverse Search

Press Ctrl+R to interactively search your command history:
1. Start search: Press Ctrl+R to activate reverse history search.
2. Enter query: Enter text to search previous commands - The search term is highlighted in the matching results.
3. Navigate matches: Press Ctrl+R again to cycle through earlier matches.
4. Accept match:
Press Tab or Esc to accept the current match and continue editing.
Press Enter to accept and run the command immediately.
5. Cancel search:
Press Ctrl+C to cancel and restore the original input.
Press Backspace to cancel when the search is empty.
The search displays matching commands and highlights the search term, making it easy to find and reuse previous input.

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 executing in the background. To run a command in the background, you can:
Prompt CodeBuddy Code to run the command in the background.
Press Ctrl+B to move a regular Bash tool call to the background. (Tmux users must press Ctrl+B twice because it is the tmux prefix key.)
Key features:
The output is buffered, and CodeBuddy can retrieve it using the TaskOutput 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)
Dev server
Long-running processes (docker, terraform)

Bash Mode with the ! Prefix

Run bash commands directly by prefixing your input with !, without going through CodeBuddy:
! npm test
! git status
! ls -la
Bash mode:
Add the command and its output to the conversation context.
Display real-time progress and output.
Supports running long-running commands in the background with the same Ctrl+B shortcut.
No need for CodeBuddy to explain or approve commands.
This is very useful for quick shell operations while maintaining conversation context.

Permission Mode

CodeBuddy Code supports multiple permission modes to control how tool usage is authorized:

Available Modes

Mode
Description
Shortcut Key to Switch
Normal mode (default)
Ask for confirmation before using tools based on permission rules.
Shift+Tab
Auto-accept edit mode
Automatically approves file edit operations (Edit/Write). Other tools still require confirmation.
Shift+Tab
Skip permission mode
Bypasses all permission checks. Recommended for use only in sandboxes without internet access.
Shift+Tab
Plan Mode
AI will create a plan and wait for approval before executing it.
Shift+Tab

Switching Permission Modes

Use Shift+Tab to switch between modes (available on all platforms, with Alt+M as an alias on Windows). You can customize keyboard shortcuts through ~/.codebuddy/keybindings.json.
Use the --permission-mode command-line argument to specify the startup mode:
codebuddy --permission-mode acceptEdits
codebuddy --permission-mode bypassPermissions
codebuddy --permission-mode plan
Set the default mode in settings.json:
{
"permissions": {
"defaultMode": "acceptEdits"
}
}

Permission Rules

Permission modes are used together with permission rules to provide fine-grained control. See the IAM documentation for details on configuring permission rules.
Note:
Type ? at any time in an interactive session to view available keyboard shortcuts and commands. Use the /help command to get more help.


Help and Support

Was this page helpful?

Help us improve! Rate your documentation experience in 5 mins.

Feedback