anthropics / anthropics/claude-code

[Feature Request] Keyboard text selection in the prompt input: Shift+Arrow to start and extend, Cmd+Shift+Arrow to the line ends

Đang mở
#93,978 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
area:tui duplicate keybindings platform:macos
Ngôn ngữ chính
Python
Star
145k
Fork
23.1k
Chỉ số merge pull request
Chỉ số pull request đang chờ

Mô tả

### Problem

Follow-up to #27561, closed as available in fullscreen with "if a specific interaction is still missing after switching, please open a focused issue for it." This is that issue: selecting text in the prompt input with the keyboard.

The habit from every macOS editor: hold Shift and press an arrow to start and extend a selection from the cursor, Cmd+Shift+Left/Right to grab to the line start or end, then Cmd+C, Backspace, or type over it.

### What happens today (2.1.270, `"tui": "fullscreen"`, Ghostty 1.3.1)

1. In the prompt input, Shift+Left/Right/Up/Down and Shift+Home/End do nothing. The `Chat` keybinding context has no `selection:*` action, and there is no `input:select*` action to bind.
2. The `selection:extendLeft/Right/Up/Down/LineStart/LineEnd` actions exist only in the `Scroll` context, and their handler returns early unless a mouse selection already exists, so they cannot start a selection in the transcript either.
3. The terminal is not in the way. Ghostty's default shift+arrow binds are `performable`, so they pass through to Claude Code whenever Ghostty has no selection of its own.

### Proposed behavior

1. Shift+Arrow in the prompt input starts a selection at the cursor if none exists, otherwise extends it. Shift+Home/End and Cmd+Shift+Left/Right (Cmd where the terminal reports Super, otherwise the Ctrl or Meta equivalents per the keybindings docs) extend to the line ends.
2. Cmd+C or Ctrl+Shift+C copies the selection, Backspace deletes it, typing replaces it, any unshifted movement clears it.
3. Expose the actions (`input:select*`, or `selection:*` in the `Chat` context) so they can be rebound in keybindings.json.

Related: #23396 (closed as a duplicate of #14789, which was closed not planned before fullscreen shipped), #21855, #52912.

### Environment

Claude Code 2.1.270, macOS (Darwin 25.6), Ghostty 1.3.1, fullscreen TUI.

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.