github / github/copilot-cli

Bug Report: Bash tool fails to create PTY sessions in iTerm2 (macOS)

オープン
#2,726 コメント 0 件 リアクション 1 件 担当者 0 名 GitHub で見る
area:tools
主要言語
Shell
スター
11.2k
フォーク
1.9k
平均マージ
14時間 16分
マージ済み PR(30日)
6

説明

### Describe the bug

**Version:** GitHub Copilot CLI 1.0.27 (npm install)

**OS:** macOS, Apple Silicon (arm64)

**Terminal:** iTerm2 (`TERM_PROGRAM=iTerm.app`, `TERM=xterm-256color`)

**Shell:** zsh 5.9

---

## Description

The bash tool (used by the agent to run shell commands) completely fails to spawn PTY sessions. Every command attempted immediately returns an invalid shell ID with "no active shell sessions", producing zero output. This makes the agent unable to execute any shell commands.

**The `!` shell command prefix works fine**, meaning process spawning itself is not the issue — only the PTY-based bash tool is broken.

**Does NOT reproduce** when running Copilot CLI from VS Code (same machine, same user).

## Expected Behavior

Shell commands execute normally as they do in VS Code.

## Workarounds Attempted (none helped)

- Reinstalled via npm
- Launched with `PAGER=` unset
- Launched with `TERM_PROGRAM=` unset
- Relaunched multiple times

## Environment

- `TERM_PROGRAM=iTerm.app`
- `TERM=xterm-256color`
- `SSH_TTY` — empty (not SSH)
- `ulimit -u` (max processes): 2666
- `ulimit -n` (file descriptors): 10240

### Affected version

GitHub Copilot CLI 1.0.27.

### Steps to reproduce the behavior

1. Open iTerm2 on macOS
2. Launch `copilot` in a git repository
3. Ask the agent to run any shell command (e.g. "run git branch")
4. Observe: shell ID is immediately invalid, no output ever produced

### Expected behavior

_No response_

### Additional context

-macOS
- iterm2, reproduced with native terminal too

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

Start by reproducing the PTY failure in iTerm2 on macOS with Copilot CLI 1.0.27, then compare it with VS Code and the working ! shell command. Trace the bash tool's PTY session creation and invalid shell ID behavior; done means shell commands produce output normally in iTerm2 and native terminal environments.

索引モデルが issue の本文から書いたものです。

評価

技術スタック
shell
領域
cli, operating-systems
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
静か
明瞭さ
おおむね明確
初心者へのやさしさ
45/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。