kimi-code/docs/zh/reference/keyboard.md
Kai f6a9c39e22
feat(kimi-code): NotifyUser tool and mid-turn update panel (#3524)
* feat(kimi-code): two-line collapsed tool cards with width-aware headers

Collapsed cards now show the call on line one and a single dim outcome
row on line two: a Bash command's last output line (the live tail while
running) with a line-count chip, a Grep/Glob path sample, or a generic
tool's first output line. Read groups stay header-only and honor the
global expand state; failed calls keep their preview. Headers split into
head / flexible / tail segments so a long command fills the terminal
width before the chip.

* feat(kimi-code): NotifyUser tool and mid-turn update panel

Add an experimental NotifyUser tool (flag notify_user, off by default)
that agent-core-v2 offers only when the host declares the update_panel
UI capability at bootstrap; the TUI declares it through the SDK harness
options. The system prompt's guidance to send updates is injected only
when the tool is active for the agent. The TUI renders the turn's
updates in a panel above the editor (stacked, 8-row window, Ctrl+N pages
back) that the next turn clears, and keeps a one-line card in the
transcript.

* feat: add subagent updates and bidirectional paging

* fix: preserve session tools and prompts when toggling updates

* fix: correct notification delivery and CI regressions
2026-09-08 13:47:23 +08:00

4.7 KiB
Raw Blame History

键盘快捷键

Kimi Code CLI 的 TUI 交互模式支持一套键盘快捷键。键位按使用场景分为五组:通用输入、模式切换、流式输出期间、工具输出控制、审批面板,以及弹窗浏览。在 TUI 中输入 /help 可随时打开内置快捷键清单。

通用快捷键

以下键位在输入框中始终可用:

快捷键 功能
Enter 提交当前输入
Shift-Enter / Ctrl-J 在输入中插入换行
↑ / ↓ 浏览输入历史
Esc 关闭弹窗 / 取消补全 / 中断流式输出或上下文压缩
Ctrl-C 中断当前流式输出,或清空输入框
Ctrl-D 在输入框为空时退出 Kimi Code CLI
Ctrl-T 待办列表被截断时,展开或折叠完整列表
Ctrl-P 实验性 Updates 面板有多页时,查看上一页
Ctrl-N 实验性 Updates 面板有多页时,查看下一页

流式输出期间按 Ctrl-C 会立即取消,无需二次确认。

退出程序(输入框为空时按 Ctrl-C,或按 Ctrl-D)使用「双击确认」机制:第一次按下后状态栏会出现提示,再按一次相同的键才真正退出。中途按其他键会清除确认状态。

模式切换

快捷键 功能
Shift-Tab 切换 Plan 模式
! 在空输入框中进入 Shell 模式

按 Shift-Tab 可开启或关闭 Plan 模式。开启后,Agent 会优先使用只读工具进行研究和规划,并可写入当前计划文件;Bash 按当前权限模式和普通规则处理,不会因 Plan 模式额外发起独立审批。单纯切换模式不会创建空计划文件。再次按 Shift-Tab 退出 Plan 模式。

在空输入框中键入 ! 进入 Shell 模式,可直接运行终端命令;命令运行期间按 Ctrl+B 可将其转为后台任务。详见交互与输入。

输入与编辑

快捷键 功能
Ctrl-G 在外部编辑器中编辑当前输入
Ctrl-V 粘贴剪贴板中的图片或视频(Unix / macOS)
Alt-V 粘贴剪贴板中的图片或视频(Windows)
Ctrl-- 撤销(Undo)
Esc Esc 双击打开撤销选择框(空闲状态下)

按 Ctrl-G 会打开外部编辑器,编辑器按以下优先级选择:

  1. /editor 命令配置的编辑器
  2. $VISUAL 环境变量
  3. $EDITOR 环境变量

保存并退出后,编辑内容替换输入框;不保存退出则保持原样。

粘贴图片或视频时,输入框中显示占位符,实际媒体数据在提交时一并发送给模型。优先从系统剪贴板读取;Linux 上会尝试 Wayland 与 X11,WSL 下还会通过 PowerShell 兜底读取 Windows 剪贴板。

流式输出期间

流式输出(streaming)期间,输入框依然可以接收输入,并支持以下额外操作:

快捷键 功能
Ctrl-S Steer:将当前输入立即注入正在运行的轮次
Esc 中断当前流式输出
Ctrl-C 中断当前流式输出

按 Ctrl-S 时,模型会在下一个可中断的时机立刻看到你的消息,无需等待当前轮次结束。

工具输出

快捷键 功能
Ctrl-O 展开或折叠工具输出、Shell 命令输出和压缩摘要

历史中存在折叠的工具调用结果或 Shell 命令输出时,按 Ctrl-O 可在折叠和展开之间切换。压缩完成后,同一个快捷键也会在压缩块中显示或隐藏压缩摘要。

审批面板

当 Agent 发起需要确认的工具调用时,TUI 会弹出审批面板。详细审批流程见交互与输入,面板内可用键位如下:

快捷键 功能
↑ / ↓ 在候选选项之间移动光标
Enter 确认当前选中的选项
1 ~ 9 直接选择对应序号的选项
Esc / Ctrl-C / Ctrl-D 拒绝当前请求
Ctrl-E 面板包含 diff 或文件内容预览时,展开或折叠完整内容
Ctrl-O 切换其他工具输出的折叠状态

需要附带反馈的选项(如「Reject」「Revise」)会在确认后切换到反馈输入态:直接输入反馈文本,按 Enter 提交;按 Esc 退出反馈输入并回到候选列表。

弹窗模式

输入 /help 打开帮助面板后,可使用以下键位浏览和关闭面板:

快捷键 功能
↑ / ↓ 单行滚动
PageUp / PageDown 每次滚动 10 行
Esc / Enter / q / Q 关闭面板

下一步