Documentation
¶
Overview ¶
Package logcolor centralises the environment that makes CLI tools emit ANSI colour when lerd runs them with no TTY attached. Workers, UI-run commands and container execs all write to a pipe, a log file or the journal, so tools like artisan, composer, vite and pest disable colour on their own unless told otherwise. The web UI renders the escapes, so we ask for them everywhere.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PodmanExecArgs ¶
func PodmanExecArgs() []string
PodmanExecArgs returns the flags to add to a `podman exec` invocation.
func PodmanExecTerminalArgs ¶ added in v1.32.0
PodmanExecTerminalArgs returns TerminalPassthrough as `podman exec` flags.
func QuadletEnvLines ¶
func QuadletEnvLines() string
QuadletEnvLines returns systemd `Environment=` lines for a quadlet or unit body, newline-terminated so callers can splice them into a template.
func ShellExports ¶
func ShellExports() string
ShellExports returns `export KEY=VALUE` lines for a generated guard script.
func TerminalPassthrough ¶ added in v1.32.0
TerminalPassthrough returns the colour environment an attached terminal implies for a container exec. podman forwards none of the host environment, so COLORTERM has to travel explicitly: Symfony Console and laravel/prompts read it first when they pick a colour mode, and without it hex and 256-colour styling is flattened to one of sixteen colours. NO_COLOR and FORCE_COLOR ride along so a choice made on the host holds inside the container, with NO_COLOR winning outright.
TERM is not forwarded. The images carry terminfo for the xterm family only, and Symfony matches TERM against a fixed pattern that foot, wezterm and friends fail, so the host value would turn colour off for exactly the terminals podman's pinned "xterm" keeps working today. A terminal that advertises more than sixteen colours gets xterm-256color instead, an entry every image has, which puts the eight-bit path back in reach as well.
Types ¶
This section is empty.