github / github/copilot-cli

[Bug] Resumed session injects COLORTERM=truecolor and changes prompt highlight color

オープン
#4,294 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

area:sessions area:terminal-rendering area:theming-accessibility
主要言語
Shell
スター
11.2k
フォーク
1.9k
平均マージ
14時間 16分
マージ済み PR(30日)
6

説明

Describe the bug

Resuming a Copilot CLI session can inject COLORTERM=truecolor into the spawned session process even though the launching shell and parent Copilot process have COLORTERM unset. This changes the submitted-user-prompt highlight from the terminal-palette green rendering to a gray truecolor background.

The result is inconsistent UI rendering between two Copilot sessions launched by the same WSL user, with the same global theme: "github" setting, the same Windows Terminal profile, and TERM=xterm-256color.

Process inspection showed:

  • Direct launch from Bash:
    • process is a direct child of the login shell;
    • COLORTERM is unset;
    • submitted user prompts have a green highlight.
  • Resumed session:
    • copilot --allow-all --remote --resume spawns a child Copilot process with --session-id;
    • the shell and parent Copilot process have COLORTERM unset;
    • the spawned child has COLORTERM=truecolor;
    • submitted user prompts have a gray highlight.

There is no repository-local Copilot setting or Git color configuration explaining the difference. copilot help config exposes only whole-theme presets and no prompt-background setting.

Affected version

GitHub Copilot CLI 1.0.76-3

The long-running resumed session was originally started on an earlier 1.0.76 build and survived CLI updates, but the current process/executable reports 1.0.76-3.

Steps to reproduce the behavior
  1. Open a fresh WSL2 Bash shell in Windows Terminal.

  2. Confirm the variable is absent:

    printenv COLORTERM
    
  3. Launch Copilot directly:

    copilot --allow-all --remote
    
  4. Submit a prompt and observe the user-message highlight.

  5. In another fresh shell with COLORTERM still unset, resume a saved session:

    copilot --allow-all --remote --resume
    
  6. Select a session, submit a prompt, and observe that the highlight color differs.

  7. Inspect the processes:

    ps -eo pid,ppid,args | grep '[c]opilot'
    tr '\0' '\n' </proc/<copilot-pid>/environ | grep -E '^(TERM|COLORTERM|WT_SESSION)='
    
  8. Observe that the resumed child has COLORTERM=truecolor, while its parent Copilot process and launching Bash shell do not.

Expected behavior

Copilot CLI should preserve the launching terminal's color-capability environment consistently across direct, resumed, and restarted sessions.

A resumed child process should not inject or change COLORTERM relative to its launching shell/parent. With the same terminal and theme setting, submitted user prompts should render with the same highlight colors.

Additional context
  • OS: WSL2 Linux, x86_64
  • Terminal: Windows Terminal
  • Shell: Bash login shell
  • TERM=xterm-256color in both sessions
  • Same Windows Terminal profile ID in both sessions
  • User setting: "theme": "github"
  • No repository-local theme/config override found
  • The only observed discriminator was COLORTERM=truecolor on the resumed child

Related open issues:

  • #3591 — user prompt visual distinction/configuration
  • #4292 — truecolor-related rendering differences
  • #4212 — prompt/highlight rendering differs by terminal context

This report is narrower: it concerns Copilot CLI's resumed-session process launch changing COLORTERM, producing different rendering without any terminal, user, repository, or theme-setting change.

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

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

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

説明されているとおり、WSL2 Bash で直接起動と再開起動を再現し、その後、ps と /proc//environ を使って再開された子プロセスを調べます。--session-id を指定した子プロセスがどのように起動されるかを追跡し、起動元シェルの COLORTERM の状態が保持されることを確認します。同じターミナル設定で、直接起動、再開、再起動したセッションが同じプロンプトのハイライトを表示すれば完了です。

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

評価

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

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

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