Repository navigation
Description
Describe the feature or problem you'd like to solve
Since Copilot CLI 1.0.106, color codes in plugin hook progress messages are stripped, so plugin startup banners lose their colors.
Proposed solution
Since 1.0.106, the timeline removes every ANSI escape sequence from hook progress messages, the {"type":"progress","message":"..."} lines that a sessionStart or userPromptSubmitted hook prints. Through 1.0.106-2 the same messages kept their colors. The 1.0.106 changelog explains the change ("Assistant replies, other rendered markdown ... no longer pass escape sequences and control characters from their text to the terminal, so a reply or a file cannot restyle the timeline or hide its own lines"), and that hardening makes sense for model and file text. Hook messages come from a plugin the user installed and chose to run, and built-in output such as /usage already keeps its color.
Please add an opt-in that lets a hook progress message keep a narrow allowlist of SGR (Select Graphic Rendition) sequences:
- Opt in per message, for example
"color": truein the progress JSON, or per hook entry in the hook file. - Keep only foreground colors (16, 256, and 24-bit), bold, italic, underline, and resets. Strip everything else as today: cursor movement, erase, OSC titles and hyperlinks, conceal, and background colors.
- Keep stripping all color under
NO_COLOR,--no-color, or a terminal without color support.
Example prompts or workflows
Minimal repro in the user hooks directory:
~/.copilot/hooks/color-test.json
{
"version": 1,
"hooks": {
"sessionStart": [
{
"type": "command",
"bash": "bash \"$COPILOT_HOOK_DIR/color-test.sh\"",
"timeoutSec": 5
}
]
}
}~/.copilot/hooks/color-test.sh
#!/usr/bin/env bash
printf '{"type":"progress","message":"\\u001b[38;2;118;234;255mcolored\\u001b[0m plain"}\n'Start copilot in a TrueColor terminal.
- Expected (as in 1.0.105 and 1.0.106-2):
coloredin light blue. - Actual (1.0.106 through 1.0.119-4):
colored plainin the default color; the escape sequences are removed.
Real-world case: Rhyolite, an open-source Copilot CLI plugin, shows a startup plaque with a blue TrueColor gradient from its sessionStart and userPromptSubmitted hooks. In Copilot CLI the plaque now renders without color. The same plaque keeps its gradient when Rhyolite prints it directly to a terminal.
Additional context
- Environment: Copilot CLI 1.0.119-4, Linux x86_64 (Fedora 44), tmux with
TERM=tmux-256colorandCOLORTERM=truecolor;NO_COLORunset and no--no-color. - I found no supported way for a plugin or extension to keep color in a transcript entry, and the interactive UI uses the alternate screen, so text printed before launch is not visible during the session.
- Related: Let extensions render fenced code blocks in the transcript #5499 (extension rendering in the transcript) and Support OSC 8 terminal hyperlinks in MCP progress notification messages #1837 (OSC 8 links in MCP progress messages).
Activity
Document that Copilot CLI shows the plaque without color