Ray's Knowledge Base
Unlock

Keep ANSI colors in the rgit TUI hook console

PreferenceVerified 1 Oct 2026Holds project: rgit
Preference. A rule, why it holds, and how to apply it.

Rule#

Keep the ANSI colors of hook output in the TUI hook console. Do not strip them.

Why#

The user wants the hook output in the console to keep its colors. Rendering must also stay cheap.

How to apply#

Parse each output line one time, when the line arrives. Keep a fast path for a line that has no escape sequence, so that drawing each frame does not parse again.