Ctrl+C while copying selected text cancels and declines confirmation dialog
还没有人认领这个 Issue。
- 主要语言
- Shell
- 星标
- 11.2k
- 派生
- 1.9k
- 平均合并
- 14 小时 16 分钟
- 30 天内合并 PR
- 6
描述
Describe the bug
When Copilot CLI displays a confirmation dialog containing a multi-line script and waits for me to confirm that I ran it, I highlight part of the script and press Ctrl+C to copy the selected text.
Instead of copying the selection while leaving the dialog open, Copilot CLI closes the dialog, removes its contents, and tells the agent that I declined the prompt. I then cannot copy the remaining commands, and the agent incorrectly proceeds as though I intentionally rejected the confirmation.
Windows Terminal may deliver Ctrl+C as an interrupt, but converting that interrupt into a semantically "declined" answer and removing the only visible copy of the script is CLI-level behavior. Cancellation and explicit decline should not be treated as equivalent.
Affected version
GitHub Copilot CLI 1.0.84-3
Steps to reproduce the behavior
- Open Windows Terminal with PowerShell.
- Start
copilot. - Ask Copilot to provide a multi-line script and then display a confirmation dialog that waits for confirmation that the script has been run.
- Use the mouse to highlight the first part of the displayed script.
- Press Ctrl+C with the intention of copying the selected text.
- Observe that the confirmation dialog closes and its contents disappear.
- Observe that Copilot reports the prompt to the agent as declined, even though no decline option was selected.
- Attempt to copy the remaining part of the script and observe that it is no longer available.
Expected behavior
When text is selected inside a confirmation dialog, copying that text must not submit a declined response or permanently remove the dialog contents. If Ctrl+C is handled as cancellation rather than copy, the CLI should distinguish cancellation from an explicit decline and preserve the dialog or its script in the conversation timeline so it remains copyable.
Additional context
- Reproducibility: Happens consistently when I press Ctrl+C after selecting text in a blocking confirmation dialog.
- Operating system: Microsoft Windows 11 Enterprise, version 10.0.26200
- CPU architecture: x64
- CPU: AMD EPYC 7763 64-Core Processor
- Terminal emulator: Windows Terminal
- Shell: PowerShell 7.6.6
- Copilot CLI help currently documents
ctrl+cascancel. - The incorrect behavior is specifically that cancellation is returned to the agent as an explicit decline and the dialog content disappears.
- Debug logs: Attach a debug log from a reproduction if available.
- Suggested regression test: Render an elicitation dialog, deliver Ctrl+C while text is selected, and verify that the dialog does not produce a declined response and that its content remains recoverable.
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
从复现中描述的 Copilot CLI 询问或确认对话框以及 Ctrl+C 取消路径开始;该 issue 未提及源文件或现有测试路径。在 Windows Terminal 中使用 PowerShell 复现该问题,然后添加建议的回归测试覆盖,并验证复制选中的文本不会提交被拒绝的响应,且脚本仍可恢复。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- powershell, shell
- 领域
- cli
- Issue 类型
- 缺陷
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 活跃
- 描述清晰度
- 基本清楚
- 新手友好度
- 55/100