
Terminal Configuration 不是普通外观设置,而是 Claude Code 在不同终端里把按键、通知、渲染和主题信号接对的故障排查手册。本篇按换行、Option-as-Meta、通知、tmux、主题、fullscreen、大粘贴和 Vim mode 拆解,并给出一套可直接照抄的开发者配置顺序。
| 你看到的现象 | 先查哪一层 | 原因 |
|---|---|---|
| Shift+Enter 不能换行 | 终端配置 | 终端可能根本没把 Shift+Enter 和 Enter 区分开。1 |
| 想把 Enter 改成换行、Shift+Enter 改成提交 | Keybindings | 这是把 chat:newline 和 chat:submit 重新映射。2 |
| Option+P 打不开模型选择器 | 终端配置 | macOS 终端通常默认不把 Option 当 modifier 发送。1 |
| tmux 里通知、进度条消失 | tmux passthrough | tmux 默认可能吞掉外层终端需要的 escape sequence。1 |

| 终端 | Shift+Enter 换行状态 |
|---|---|
| Ghostty、Kitty、iTerm2、WezTerm、Warp、Apple Terminal、Windows Terminal | 无需配置即可工作。1 |
| VS Code、Cursor、Devin Desktop、Alacritty、Zed | 运行一次 /terminal-setup。1 |
| gnome-terminal、JetBrains IDE 终端 | 不支持;用 Ctrl+J 或 \ + Enter。1 |
/terminal-setup 要在宿主终端里跑,不要在 tmux 或 screen 里面跑。它需要写宿主终端的配置文件,套一层 multiplexer 后,Claude Code 可能摸不到真正要改的配置。1~/.claude/keybindings.json。例如把 ctrl+x 绑成换行,需要在 Chat context 里把对应 keystroke 映射到 chat:newline;keybindings 文档同时说明,chat:submit 的默认键是 Enter,chat:newline 的默认键是 Ctrl+J。2Option+Enter 换行、Option+P 切模型。macOS 上的麻烦是:很多终端默认不把 Option 当 modifier 发送,所以你按了,Claude Code 收不到。1| 终端 | 设置入口 |
|---|---|
| Apple Terminal | Settings → Profiles → Keyboard,勾选「Use Option as Meta Key」。1 |
| iTerm2 | Settings → Profiles → Keys → General,把 Left / Right Option key 设成 Esc+。1 |
| VS Code | 在设置里加 "terminal.integrated.macOptionIsMeta": true。1 |
/terminal-setup 处理过:它会启用 Option as Meta,并把 audio bell 改成 visual screen flash。1preferredNotifChannel 设成 "terminal_bell",或者用 Notification hook 播放声音、执行命令。1~/.claude/settings.json:1{
"hooks": {
"Notification": [
{
"hooks": [{ "type": "command", "command": "afplay /System/Library/Sounds/Glass.aiff" }]
}
]
}
}~/.tmux.conf 加三行,然后执行 tmux source-file ~/.tmux.conf。1set -g allow-passthrough on
set -s extended-keys on
set -as terminal-features 'xterm*:extkeys'
set -g mouse on,否则滚轮事件会被 tmux 自己处理。Fullscreen 文档也提醒,iTerm2 的 tmux -CC integration mode 不适合开启 fullscreen rendering。3/theme 管 Claude Code 的配色,不管你的终端主题/theme 只改变 Claude Code 界面里的颜色;终端应用自己的配色,仍然在终端应用里设置。1~/.claude/themes/,文件名去掉 .json 后就是 slug;文件里有三个可选字段:name、base、overrides。1{
"name": "Dracula",
"base": "dark",
"overrides": {
"claude": "#bd93f9",
"error": "#ff5555",
"success": "#50fa7b"
}
}error、warning、success、permission、planMode、diffAdded、diffRemoved 这些 token,直接影响你在终端里扫失败、权限、计划模式和 diff 的速度。官方的 token reference 也按 text/accent、status、input box、diff、fullscreen 等组划分。1/tui fullscreen。官方 fullscreen 文档说明,这个模式把界面画到终端的 alternate screen buffer,只渲染当前可见消息,所以长会话里的内存使用更稳定。3
/tui fullscreenCLAUDE_CODE_NO_FLICKER=1 claudeCtrl+o,再用 / 搜索;如果需要把内容写回终端原生 scrollback,可以在 transcript mode 里按 [。3/terminal-setup 会把 terminal.integrated.gpuAcceleration 设成 "off",避免 integrated terminal 乱码;同时会调整 terminal.integrated.mouseWheelScrollSensitivity,让 fullscreen mode 里滚动更顺。1[Pasted text] 占位符,避免输入框失控;提交时,完整内容仍会发送给 Claude。1[Pasted text] 后再提交。.claude/ 约定文件。/config → Editor mode 开启,或者把 editorMode 设成 "vim"。这个字段属于 settings.json 的可用配置项。14o / O,或 Ctrl+J。1/terminal-setup,再把 Ctrl+J 当保底肌肉记忆。1preferredNotifChannel: "terminal_bell" 或 Notification hook。1/tui fullscreen。 这是渲染路径切换,不是普通外观设置;切过去后要适应 transcript mode 的搜索和复制方式。3docs.anthropic.com
docs.anthropic.com
docs.anthropic.com
docs.anthropic.com
This story was produced automatically by a channel. One sentence is all it takes for Neodrop to keep producing for you.