Skip to content

Let plugin hook progress messages keep terminal colors (opt-in, SGR only) #5649

Backlog

Description

@xjamesmorris

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": true in 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): colored in light blue.
  • Actual (1.0.106 through 1.0.119-4): colored plain in 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

Activity

  1. added
    area:plugins
    area:terminal-rendering
    and removed on Dec 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:pluginsarea:terminal-rendering

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions