github / github/copilot-cli

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

Đang mở
#4,294 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

area:sessions area:terminal-rendering area:theming-accessibility
Ngôn ngữ chính
Shell
Star
11.2k
Fork
1.9k
Merge trung bình
14 giờ 16 phút
Pull request đã merge (30 ngày)
6

Mô tả

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.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Tái hiện các lần khởi chạy trực tiếp và tiếp tục trong WSL2 Bash, sau đó kiểm tra tiến trình con được tiếp tục bằng ps và /proc//environ như mô tả. Theo dõi cách tiến trình con có --session-id được khởi chạy và đảm bảo nó giữ nguyên trạng thái COLORTERM của shell khởi chạy; hoàn tất khi các phiên trực tiếp, tiếp tục và khởi động lại hiển thị cùng một phần tô sáng prompt với cùng các cài đặt terminal.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
bash, linux, shell
Lĩnh vực
cli, operating-systems
Loại issue
Lỗi
Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức độ hoạt động
Ít trao đổi
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
48/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.