Skip to content

feat(macos): add Command-arrow terminal line navigation - #1086

Open
Life-go-on wants to merge 1 commit into
Kuddev:mainfrom
Life-go-on:feat/macos-command-arrow-line-navigation
Open

Life-go-on wants to merge 1 commit into
Kuddev:mainfrom
Life-go-on:feat/macos-command-arrow-line-navigation

Conversation

@Life-go-on

@Life-go-on Life-go-on commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Advertising, commercial promotion, and traffic solicitation are prohibited in PRs
and Issues. Business requests must go through the email in the
contribution policy.
PRs or Issues containing unauthorized promotion will be closed directly.
严禁利用 PR 或 Issue 推广、引流,未经授权的推广将直接关闭;商业需求请通过贡献指南中的邮箱沟通,已获批准的赞助按批准范围处理。

Result / 用户结果

在 macOS 的 Pebrel 终端中,添加按 ⌘← 可以跳到行首,按 ⌘→ 可以跳到行尾的键盘映射,保证与 macOS 文本输入习惯一致。原有 Control 快捷键和普通方向键的行为不变。

Design / 设计边界

  • Responsibility and affected modules: 改动限定在 GPUI 终端按键编码模块 pebrel_app/src/gpui_shell/terminal/keymap.rs。
  • Why this belongs here; interfaces that remain unchanged: 在终端编码层将 ⌘← 和 ⌘→ 分别映射为 Ctrl+A 和 Ctrl+E,再复用当前终端窗格已有的键盘协议编码逻辑。不修改设置、搜索等普通输入框,也不改变现有接口。
  • Dependency, data-format, threading, or lifetime changes (ADR if applicable): 无依赖、数据格式、线程或生命周期变更,不涉及 ADR。
  • Compatibility and migration/fallback behavior: 仅在 macOS 上匹配未叠加其他修饰键的 ⌘← 和 ⌘→。其他按键组合及非 macOS 平台行为不变,无需迁移配置。

Evidence / 验证依据

  • Commands and actual results (include unrun checks):
    • cargo test --locked --release -p pebrel --bin pebrel gpui_shell::terminal::keymap::tests:在 macOS Apple Silicon 上运行,27 项通过。
    • python3 scripts/check_architecture.py --base 76f74be1、git diff --check 和改动文件的格式检查均通过。
    • 未在本地运行 Windows、Linux 或全量应用测试。
  • Regression tests: what fails before the fix? 修复前,终端会把 ⌘← 和 ⌘→ 编码为普通方向键,无法跳到行首或行尾。新增测试覆盖两个方向在传统和增强键盘协议下的编码,并验证叠加其他修饰键时仍沿用原有行为。
  • UI changes: screenshots, long translations, keyboard access, DPI checks: 已在包含同一补丁的 macOS 预览包中手动验证两个快捷键。没有界面布局或文案变更,不涉及截图、长译文或 DPI 检查。
  • Hot-path changes: allocation/work/load measurements, where applicable: 未运行性能基准。只有命中上述两个 macOS 组合键时,才会构造对应的按键并交由现有编码器处理。

Required Review / 必须确认

  • I followed CONTRIBUTING.md, docs/architecture.md, and docs/project-constraints.md.
  • I split responsibilities, not arbitrary line ranges; no duplicate behavior authority was added.
  • python3 scripts/check_architecture.py --base <PR-base-commit> passes; budgets were not inflated to fit the change.
  • Tests cover success and failure; platform/feature coverage limitations are stated.
  • New messages use typed i18n IDs and matching placeholders; untranslated content has an explicit fallback. (没有新增或修改 UI 文案)
  • Governance changes include a counterexample, corrected contract, tests, and a maintainer-reviewed decision. ( 没有修改工程规则或检查门禁)

Checkboxes explain the review; they do not replace CI or maintainer approval.

Co-Authored-By: Claude Code <noreply@anthropic.com>
@Life-go-on
Life-go-on requested a review from Kuddev as a code owner November 22, 2026 06:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant