Skip to content

Unify mode shortcuts across desktop and CLI / 统一桌面端与 CLI 模式快捷键#3885

Merged
esengine merged 1 commit into
main-v2from
codex/unify-mode-shortcuts
Jun 11, 2026
Merged

Unify mode shortcuts across desktop and CLI / 统一桌面端与 CLI 模式快捷键#3885
esengine merged 1 commit into
main-v2from
codex/unify-mode-shortcuts

Conversation

@SivanCola

@SivanCola SivanCola commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Unify mode shortcut behavior so Shift+Tab toggles Plan only, while Ctrl+Y / Cmd+Y toggles YOLO where the client can capture it.
  • Keep paste on the platform paste shortcuts and preserve /paste-image for CLI image paste.
  • Preserve [ui].shortcut_layout as a compatibility setting while removing layout-specific shortcut semantics.
  • Update desktop, CLI/TUI, serve UI copy, English/Chinese docs, examples, and regression tests.

Documentation links

Documentation added

English

Shortcuts are documented by client because users usually look for the keys that work in the surface they are using. The small rule is: Shift+Tab only controls Plan, Ctrl/Cmd+Y only controls YOLO, and paste stays on the platform paste key.

Desktop GUI

Key or control What it does Notes
Shift+Tab Toggles Plan on/off Composer shortcut. Plan is read-only planning and does not cycle Ask/Auto/YOLO.
Ctrl+Y / Cmd+Y Toggles YOLO on/off Composer shortcut. Turning YOLO off restores the previous Ask/Auto base when known.
Ask / Auto / YOLO approval controls Picks the tool approval posture directly Clicking these controls is unchanged by the keyboard shortcuts.
Plan control Toggles Plan on/off Same mode as Shift+Tab.
Goal item in the collaboration menu Starts, views, or clears Goal Goal is not in any keyboard cycle.
Cmd+V on macOS, Ctrl+V on Windows/Linux Pastes clipboard content Images can also be dropped into the composer.

CLI / TUI

Key or command What it does Notes
Shift+Tab Toggles Plan on/off Plan is read-only planning and does not cycle Ask/Auto/YOLO.
Ctrl+Y Toggles YOLO on/off Turning YOLO off restores the previous Ask/Auto base when known. Terminals that forward Command/Super may also send Cmd+Y, but Ctrl+Y is the reliable terminal shortcut.
--yolo, --dangerously-skip-permissions Starts chat in YOLO Same runtime mode as Ctrl+Y.
Ask / Auto No keyboard cycle Ask is the default interactive base. Auto is not entered through Shift+Tab; use clients or APIs that expose the tool approval posture directly.
Ctrl+V Pastes clipboard content The CLI tries a clipboard image first, then falls back to text paste.
/paste-image Pastes a clipboard image Use it when you want image-only paste or the terminal handles text paste itself.
/goal <objective>, /goal status, /goal clear Starts, checks, or clears Goal Goal is not in any keyboard cycle.

[ui].shortcut_layout is still accepted for old configs, but the shortcut behavior above is unified across layouts.

中文

这里按使用端来写,因为用户通常是先知道“我现在在桌面端/CLI”,再找对应按键。核心规则很小:Shift+Tab 只管 Plan,Ctrl/Cmd+Y 只管 YOLO,粘贴继续走系统粘贴快捷键。

桌面端 GUI

按键或控件 作用 说明
Shift+Tab 切换 Plan 开/关 输入框快捷键。Plan 是只读规划,不会循环 Ask/Auto/YOLO。
Ctrl+Y / Cmd+Y 切换 YOLO 开/关 输入框快捷键。关闭 YOLO 时会尽量恢复之前的 Ask/Auto 基底。
Ask / Auto / YOLO 审批控件 直接选择工具审批姿态 点击操作不受快捷键规则影响。
Plan 控件 切换 Plan 开/关 Shift+Tab 是同一个模式。
协作菜单里的 Goal 启动、查看或清除 Goal Goal 不进入任何快捷键循环。
macOS Cmd+V,Windows/Linux Ctrl+V 粘贴剪贴板内容 图片也可以直接拖进输入框。

CLI / TUI

按键或命令 作用 说明
Shift+Tab 切换 Plan 开/关 Plan 是只读规划,不会循环 Ask/Auto/YOLO。
Ctrl+Y 切换 YOLO 开/关 关闭 YOLO 时会尽量恢复之前的 Ask/Auto 基底。终端若能转发 Command/Super,也可能识别 Cmd+Y,但稳定可用的是 Ctrl+Y
--yolo--dangerously-skip-permissions 启动时进入 YOLO Ctrl+Y 是同一个运行时模式。
Ask / Auto 没有键盘循环 Ask 是默认交互基底;Auto 不通过 Shift+Tab 进入,需要由暴露工具审批姿态的客户端或 API 直接设置。
Ctrl+V 粘贴剪贴板内容 CLI 会先尝试剪贴板图片,失败后再按文本粘贴。
/paste-image 粘贴剪贴板图片 适合只想贴图片,或终端应用自己接管文本粘贴的场景。
/goal <目标>/goal status/goal clear 启动、查看或清除 Goal Goal 不进入任何快捷键循环。

[ui].shortcut_layout 仍被接受以兼容旧配置,但上面的快捷键行为已经跨布局统一。

Validation

  • git diff --check
  • go test ./...
  • npm --prefix desktop/frontend test
  • npm --prefix desktop/frontend run typecheck
  • npm --prefix desktop/frontend run test:typecheck
  • npm --prefix desktop/frontend run build

Note: the frontend build still reports the existing Vite large chunk warning.

@SivanCola SivanCola force-pushed the codex/unify-mode-shortcuts branch from bcdb1f0 to 0f729f5 Compare June 10, 2026 17:10
@github-actions github-actions Bot added v2 Go rewrite (1.x) — main-v2 branch, active development desktop Wails desktop app (desktop/**) tui Terminal UI / CLI (internal/cli, internal/control) config Configuration & setup (internal/config) labels Jun 10, 2026
@SivanCola SivanCola force-pushed the codex/unify-mode-shortcuts branch from 0f729f5 to 46f5033 Compare June 10, 2026 17:23
@SivanCola SivanCola marked this pull request as ready for review June 10, 2026 17:24
@SivanCola SivanCola requested a review from esengine as a code owner June 10, 2026 17:24
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@SivanCola SivanCola enabled auto-merge June 10, 2026 17:24

@esengine esengine left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving. Putting Plan on Shift+Tab and tool-approval on its own axis is consistent with the separate-posture model, and the unified surface (desktop / CLI / serve / docs / i18n, both EN and ZH) is thorough. toggleYoloMode's Ask/Auto base restore is correct, and the regression tests + go test/frontend gates cover it.

Two trade-offs I'm accepting knowingly so they're on the record:

  • Ctrl+Y now toggles YOLO directly (a single keystroke into --dangerously-skip-permissions, on a key that collides with readline yank / BSD DSUSP). The previous "a shortcut never crosses a permission boundary" rule is intentionally dropped here.
  • Auto has no keyboard entry in the pure TUI anymore; it's reachable via clients/APIs or as the YOLO-off restore target.

Both are fine for the direction we want. Minor, non-blocking: cycleHint() is now a trivial pass-through to ChatStatusCycleHint, and shortcut_layout still drives modeTagText despite the "removed layout-specific semantics" framing — worth tidying whenever this file is next touched. Thanks for the careful docs.

@esengine esengine merged commit 040126d into main-v2 Jun 11, 2026
13 checks passed
@esengine esengine deleted the codex/unify-mode-shortcuts branch June 11, 2026 01:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

config Configuration & setup (internal/config) desktop Wails desktop app (desktop/**) tui Terminal UI / CLI (internal/cli, internal/control) v2 Go rewrite (1.x) — main-v2 branch, active development

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants