github / github/copilot-cli

Input box pre-filled with DA1 device-attributes reply ( [?61;6;7;…c ) on startup under native-Windows zellij

未关闭
#4,267 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
area:input-keyboard area:platform-windows area:terminal-rendering
主要语言
Shell
星标
11.2k
派生
1.9k
平均合并
14 小时 16 分钟
30 天内合并 PR
6

描述

### Describe the bug

Describe the bug

When launching Copilot CLI inside a native-Windows zellij session, the input box is pre-filled on startup with a raw terminal escape sequence:

[?61;6;7;22;23;24;28;32;42c

This is a Primary Device Attributes (DA1) reply — the response to a  ESC [ c  capability query. It's meant to be consumed silently, but instead the raw bytes land in the prompt as if typed. I have to clear the box (Ctrl+U) before every session.

This looks like the same class of bug as the already-fixed #36 ("Input box always filled with escape sequence  ]11;rgb:…  on start"), which  niik  traced to Copilot querying the host terminal at startup (there: OSC 11 background color). That fix (0.0.355) evidently didn't cover the DA1 ( ESC[c ) query path.

Affected version

Copilot CLI 1.0.75 (win32-x64)

Steps to reproduce

1. On Windows 11, open Windows Terminal.
2. Start a native-Windows zellij session ( zellij ).
3. Inside a zellij pane, launch  copilot .
4. Observe the input box pre-filled with  `[?61;6;7;22;23;24;28;32;42c` .

Expected behavior

The DA1 reply is consumed by Copilot CLI; the input box starts empty.

Environment

• Copilot CLI: 1.0.75 (win32-x64)
• OS: Windows 11 Enterprise, build 26200
• Terminal emulator: Windows Terminal 1.18.10301.0
• Multiplexer: zellij 0.44.3 (native Windows — no WSL), which added a "host query forwarding" system in 0.44.x that relays capability queries between the inner app and the host terminal. The DA1 reply appears to arrive after Copilot has stopped reading, so it leaks into the input buffer.
•  TERM : (unset on native Windows)
• Process chain:  zellij → pwsh → copilot 

Additional context

• Does not occur when running  copilot  directly in Windows Terminal (no zellij) — pointing to a timing/consume issue on the query-response path when a multiplexer sits in between.
• Decoded sequence: `ESC [ ? 61 ; 6 ; 7 ; 22 ; 23 ; 24 ; 28 ; 32 ; 42 c  = DA1` reply, VT conformance level 61 + advertised feature codes.
• Related prior fix: #36 (OSC 11 reply on start, fixed in 0.0.355).

### Affected version

_No response_

### Steps to reproduce the behavior

_No response_

### Expected behavior

_No response_

### Additional context

_No response_

贡献指南

打开贡献指南

调研方向

从 Copilot CLI 启动时对 terminal-query 和 input-buffer 的处理入手,将 DA1 响应路径与 issue #36 中之前的 OSC 11 修复进行比较。在原生 Windows 上使用 zellij 0.44.3 重现,然后跟踪响应何时到达,并验证 prompt 保持为空,同时 Windows Terminal 的直接行为不变。

由索引模型根据 Issue 内容生成。

评估

技术栈
powershell, shell
领域
cli, operating-systems, tooling
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
冷清
描述清晰度
基本清楚
新手友好度
48/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。