Shell command completion never detected when running inside tmux (output appears, but command reported "still running" forever)
- 主要语言
- Shell
- 星标
- 11.2k
- 派生
- 1.9k
- 平均合并
- 14 小时 16 分钟
- 30 天内合并 PR
- 6
描述
### Describe the bug
When Copilot CLI runs **inside a tmux session**, shell tool commands execute and their **output appears correctly**, but the CLI **never detects command completion**. Even a trivial `echo hello` prints `hello` and then hangs indefinitely as "still running"; it must be manually stopped. Running the CLI **outside tmux**, the identical command completes immediately (`exit code 0`).
This is independent of tmux version and config. See matrix below.
### What this is NOT
Not the unfocused-pane keystroke bug (#4213): output is delivered fine and this is not about input/enter. This is specifically **completion/exit detection** of shell tool commands.
### Reproduction matrix
| Condition | Result |
|---|---|
| Inside tmux 2.7 | hangs -> "still running" forever |
| Inside tmux 3.3a (`escape-time 0`, `allow-passthrough on`) | hangs |
| Outside tmux | `echo hello` -> completes, exit 0 |
### Affected version
1.0.74-1 (also seen on prior versions starting from 1.0.70). Version 1.0.69 is unaffected
### Steps to reproduce the behavior
1. Start Copilot CLI **inside a tmux pane**.
2. Have the agent run a shell command, e.g. `echo hello`.
3. Output `hello` appears, but the command is reported "still running" indefinitely; only `stop` clears it.
4. Exit tmux, repeat the same command. It completes normally with exit code 0.
### Expected behavior
Shell command completion/exit should be detected the same inside and outside tmux.
### Additional context
### Environment
- Copilot CLI: **1.0.74-1** (also seen on prior version)
- OS: Linux
- Shell: /bin/bash, `TERM=xterm-256color`
- tmux: reproduced on **2.7** and **3.3a**
贡献指南
调研方向
首先使用 `echo hello` 在 tmux 内部和外部重现该问题,同时比较 shell 命令完成情况和退出状态。跟踪 CLI 对 shell 命令完成情况的检测,并确定 tmux 表现不同的原因;当命令在两个环境中都报告已完成且退出码为 0 时,即表示完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- bash, shell
- 领域
- cli, operating-systems
- Issue 类型
- 缺陷
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 冷清
- 描述清晰度
- 基本清楚
- 新手友好度
- 52/100