Skip to content

feat(keymap): add default shortcut to copy working directory - #853

Open
tikipiya wants to merge 5 commits into
Kuddev:mainfrom
tikipiya:feat/copy-working-directory-shortcut
Open

tikipiya wants to merge 5 commits into
Kuddev:mainfrom
tikipiya:feat/copy-working-directory-shortcut

Conversation

@tikipiya

@tikipiya tikipiya commented Nov 1, 2026

Copy link
Copy Markdown

Expose CopyWorkingDirectory in the editable keymap with Ctrl+Shift+L (Shift+Cmd+L on macOS), matching the tab menu and command palette action.

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 / 用户结果

  • Users can copy the focused pane’s working directory with Ctrl+Shift+L (Windows/Linux) or Shift+Cmd+L (macOS), same behavior as the tab context menu / command palette “Copy working directory” (clipboard + toast in GPUI when cwd is known).
  • The action appears under Settings → Keymap and can be rebound or cleared like other workspace shortcuts.
  • No linked issue; closes a small UX gap (action existed but had no default shortcut).

Design / 设计边界

  • Responsibility: New config::Action::CopyWorkingDirectory; GPUI CopyWorkingDirectory workspace action delegates to existing TerminalView::copy_working_directory; legacy input path uses focused_cwd_string() + clipboard (same as palette CopyCwd).
  • Unchanged: Tab menu, palette catalog, i18n strings (CommonCopyWorkingDirectory / CommonCwdCopied); SSH tab naming and cwd reporting rules unchanged.
  • Dependencies / threading / lifetime: None; synchronous clipboard write on key dispatch.
  • Compatibility: New default binding only; users with custom keybind= lines unaffected unless they override the same combo.

Evidence / 验证依据

  • Commands: cargo check -p nebula --bin pebrel --features gpui-test-support — passes locally.
  • Tests: Added copy_working_directory_default_binds_gpui_action and extended default-combo coverage for ctrl+shift+l; hardcoded_migration list updated. Full cargo test for pebrel not run locally (missing libxkbcommon-x11 on this machine); CI expected to run project checks.
  • UI: Manual — terminal focused, cwd known → shortcut copies path and shows toast; Settings keymap row shows default combo.
  • Hot path: N/A (not on render/scroll hot path).

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. (Reused existing Message::CommonCopyWorkingDirectory; no new catalog IDs.)
  • Governance changes include a counterexample, corrected contract, tests, and a maintainer-reviewed decision. (N/A — no governance change.)

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

Expose CopyWorkingDirectory in the editable keymap with Ctrl+Shift+L
(Shift+Cmd+L on macOS), matching the tab menu and command palette action.
@tikipiya
tikipiya requested a review from Kuddev as a code owner November 1, 2026 03:54
tikipiya and others added 2 commits November 1, 2026 12:57
Remove one trailing blank line so check_architecture stays at the 2575-line cap after adding CopyWorkingDirectory.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@tikipiya

tikipiya commented Nov 1, 2026

Copy link
Copy Markdown
Author

I'll fix it later when I have some free time.

tikipiya and others added 2 commits November 1, 2026 16:06
Updating the keymap filter expectations after adding the copy-cwd action.

Co-authored-by: Cursor <cursoragent@cursor.com>
@tikipiya

tikipiya commented Nov 1, 2026

Copy link
Copy Markdown
Author

Please check this over.

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