Feature Request: Support Shift+Arrow and Ctrl+A text selection in prompt input
- 主要语言
- Shell
- 星标
- 11.2k
- 派生
- 1.9k
- 平均合并
- 14 小时 16 分钟
- 30 天内合并 PR
- 6
描述
### Describe the feature or problem you'd like to solve
Currently, the input line in Copilot CLI does not support standard GUI-style text selection shortcuts:
- **Shift+Arrow keys** (e.g. Shift+Left, Shift+Right, Shift+Home, Shift+End) do not select text — they are either ignored or move the cursor without selection
- **Ctrl+A** moves the cursor to the beginning of the line (readline behavior) instead of selecting all input text
This makes it impossible to select a portion (or all) of the input in order to copy, cut, or replace it using familiar keyboard-driven workflows. In contrast, mouse selection + Ctrl+Shift+C does work via Windows Terminal, but keyboard-only text selection is not available.
> **Note:** This is distinct from existing issues about readline cursor navigation (e.g. #1069) — the request here is specifically for **visual text selection** support in the prompt input, similar to how text editors and modern terminal input fields behave.
### Proposed solution
Support shift-based text selection in the prompt input field:
- Shift+Left / Shift+Right — extend selection by character
- Shift+Home / Shift+Ctrl+Left — extend selection to beginning
- Shift+End / Shift+Ctrl+Right — extend selection to end
- Ctrl+A — select all input text (with a visual highlight), rather than just moving the cursor
Selected text should be copyable via the platform copy shortcut and replaceable by typing.
### Example prompts or workflows
1. Typed a long prompt and want to replace a specific phrase → Shift+click or Shift+arrow to select it, then type the replacement
2. Want to copy the entire current input to reuse it → Ctrl+A then Ctrl+C
3. Want to select from cursor to end of line to cut it → Shift+End, then Ctrl+X
### Additional context
- **OS:** Windows
- **Terminal:** Windows Terminal
- **Shell:** PowerShell 7
- **Related issue:** #1684 (Cut/Undo shortcuts) — text selection is a prerequisite for useful Cut support
贡献指南
调研方向
The issue names no files or tests, so begin by locating the Copilot CLI prompt input and keyboard-shortcut handling. Reproduce the behavior in Windows Terminal with PowerShell 7, then verify that the specified Shift+Arrow, Shift+Home/End, Shift+Ctrl+Arrow, and Ctrl+A combinations visibly select text that can be copied, cut, or replaced by typing.
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- powershell, shell
- 领域
- cli
- Issue 类型
- 功能
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 活跃
- 描述清晰度
- 基本清楚
- 新手友好度
- 52/100