Skip to content

fix(keymap): release macOS Control character defaults - #658

Merged
YinBuLiao merged 5 commits into
mainfrom
fix/macos-control-shortcuts-656
Oct 16, 2026
Merged

YinBuLiao merged 5 commits into
mainfrom
fix/macos-control-shortcuts-656

Conversation

@YinBuLiao

@YinBuLiao YinBuLiao commented Oct 15, 2026 •

Copy link
Copy Markdown
Collaborator

Result / 用户结果

Refs #656. In the macOS GPUI workspace, Control+K reaches the terminal as kill-line while Command+K opens the Shell picker. The same default-source policy releases plain Control character shortcuts for paste, font size and numbered tabs. Explicit user Control bindings still take precedence.

Design / 设计边界

The workspace and settings editor select an immutable GPUI keymap policy. It derives defaults from the existing tables, removes only macOS GUI defaults with exactly Control plus a character, and applies the existing Command aliases consistently to registration, display, clear and reset. Legacy callers retain their original model and a separate immutable cache, including when both renderers are compiled.

GPUI's stored digitN and logical digit spellings share the identity already used by its runtime adapter. Clearing another action therefore preserves an explicit owner of that key. The stored format, ordering, source priorities, component editing bindings and terminal encoder are unchanged. No dependency, protocol, native modifier adapter or mutable frontend selector is added.

Ctrl+Tab, Ctrl+Shift/Ctrl+Alt navigation, Option digits and the separate global quick-terminal hotkey retain their current defaults. This is a focused workspace change, not a migration of every Control shortcut.

Related #653 adds an optional clear-screen action; this PR does not duplicate it. That PR's assertion that Ctrl+K remains the picker needs the macOS platform distinction when combining the changes. #534's source replacement and Input editing contracts remain covered.

Evidence / 验证依据

Pinned Rust 1.97.1 on macOS ARM64; base a2f9b0f666267d1f71e5360e5846b00d2e56c575:

  • Three regressions actually ran and failed with the original default/dispatch behavior. A further digit-alias regression failed before identity matching was corrected.
  • Final suites passed: 21 shared keymap tests, 26 workspace keybinding tests, 13 settings-pane tests and 26 terminal keymap tests. They exercise real virtual-window dispatch through TerminalView to its owned Msg::Input receiver, explicit overrides, removal/restoration, digits, Input paste and multiple windows.
  • Formatting, architecture against the actual base, unchanged platform-cfg budget, 54 governance tests, 99 settings tests, 24 i18n tests (one existing benchmark ignored), two file-budget tests, the default GPUI test graph and the actual GPUI product build passed. Cargo checks used --locked --offline and the pinned toolchain.
  • An owned /bin/zsh -dfi PTY test confirmed that sending 0x0b at the cursor removed the trailing DELETED text; the control case retained it. This does not claim physical AppKit keyboard or user-shell acceptance.
  • Existing settings-navigation UI tests use Command digits on macOS and Control digits on other hosts while retaining every navigation and invalid-index assertion. The two corrected cases each passed in an independent local test process.
  • A separate, unchanged density-layout UI test failed locally both alone and in its suite. The exact same assertion (left 0 / right 1) also failed on the unchanged base under the same owned configuration. This is a local baseline limitation, not a passed test; no cause is inferred.
  • Optional legacy-only and dual-renderer test builds remain blocked by seven and six compiler errors respectively. The same commands reproduced matching diagnostics on the unchanged base (theme_library/Decorations/palette, plus the dual build's wallpaper visibility error). These are not passed tests; no legacy runtime acceptance is claimed.

The earlier commit cf77ccd4c69bddad24bf8f82a1adb87081013260 failed two existing settings-navigation assertions in its macOS ARM64 manual and automatic CI because those tests still pressed Control digits. The test inputs are corrected in current commit 39da88db89c63585fba2e8c6a0cc642ea8dd3dbf; the failed runs and logs are retained.

Full native validation passed on current commit 39da88db89c63585fba2e8c6a0cc642ea8dd3dbf in run 38728815797 (first attempt). All five actual native jobs completed the full workspace/harness, separate doctests, default GPUI product checks and release workspace checks. Each of the seven final reports emitted the actual Executed message for this run's exact five-platform matrix. The automatic PR run, architecture-contracts and PR-size checks also passed on their first attempt. All four current-SHA runs succeeded; all 30 current check runs are complete (28 success, two expected diagnostic skips).

Native platform nextest ordinary PASS LEAK skipped
Ubuntu 24.04 2865 0 29
Windows x64 3037 8 39
Windows ARM64 3035 8 39
macOS ARM64 2877 0 30
macOS Intel 2877 0 30

All six new regressions passed on their applicable native platforms. Both corrected settings-navigation cases and the unchanged density-layout case were ordinary PASS on all five hosts. Skipped tests are not counted as passed. Windows LEAK results were accepted by the unchanged CI configuration; their names and counts are retained, without a baseline or cause claim.

Physical keyboard acceptance, screenshots, DPI/long-translation review and interactive CLI acceptance have not been performed.

Required Review / 必须确认

  • Followed the contribution, architecture and project-constraint rules; budgets and gates were not relaxed.
  • Kept one shared keymap algorithm with explicit caller policy; no persisted schema or second behavior authority was added.
  • Added regressions for the defect, explicit ownership and restoration; platform and feature limitations are stated.
  • Existing key labels and translation contracts are retained; no new translatable message was added.
  • No governance or CI policy changed.
  • Current-commit execution on all five native platforms, full workspace/harness and release checks, and seven final reports have passed.

Cache script bytes and pending writes instead of permanently memoizing a
temporary path or a failed first write. Recreate missing files under the
per-layout lock, retaining retry state after partial I/O failures.

Refs #622.
Use the Command defaults for the GPUI workspace while preserving plain
Control characters for terminal input and explicit user overrides. Keep
legacy keymap semantics through caller-selected immutable policies, and
match GPUI digit aliases consistently when displaying, clearing or
restoring shortcuts.

Refs #656.
@github-actions github-actions Bot added the size/L 501–1500 行 label Oct 15, 2026
Exercise Command digits on macOS and Control digits on other hosts
while retaining the settings navigation and invalid-index assertions.

Refs #656.
@YinBuLiao
YinBuLiao marked this pull request as ready for review October 15, 2026 12:23
@YinBuLiao
YinBuLiao requested a review from Kuddev as a code owner October 15, 2026 12:23

@Kuddev Kuddev 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.

已复核 macOS Control 单字符默认键的共享策略、GPUI/legacy 隔离及显式用户覆盖。真实终端接收测试验证 Control 字节、Command shell picker 与数字键清除/恢复;保留特殊控制键及组合修饰键。当前提交只整合已审查的主线和 #654,未发现新的语义变化。该精确 head 的十项必需检查及全部已选 Native tests 均成功;本次未声明独立 macOS 物理键盘验收。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/L 501–1500 行

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants