compose/cmd/display
Nicolas De Loof cccb9f1f7e cli: display.Mode always resolves to the mode actually rendered
The display.Mode package global was left as "auto" on the most common
path (auto mode with an interactive or redirected terminal), so readers
like `up`'s NavigationMenu gate saw an unresolved value; that gate also
compared against the string literal "plain" instead of the constant.
applyDisplayMode wrote a mode that selectEventProcessor could then
contradict (--ansi always with a redirected stderr rendered Plain while
Mode said tty).

selectEventProcessor becomes the single resolution point: every branch
assigns the mode matching the renderer it returns, so after command
setup the global never holds ModeAuto. applyDisplayMode loses its
redundant writes and its misleading name (now applyAnsiMode); the
contract is documented on the Mode variable, and the existing
selectEventProcessor tests now pin the resolved mode for every branch.

Side effect, deliberate: with stderr redirected (auto -> plain
rendering) the navigation menu is no longer offered; it used to slip
through because Mode still read "auto".

Part of #14074 (section E).

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2026-08-20 15:10:15 +02:00
..
colors.go
dryrun.go make DRYRUN_PREFIX a display attribute, move DryRunClient out of pkg/api 2025-11-12 11:17:28 +01:00
json.go chore: explicit, unique, greppable names for internal identifiers 2026-08-20 11:17:11 +02:00
json_test.go golangci-lint: use gci formatter instead of goimports 2025-12-01 12:21:50 +01:00
mode.go cli: display.Mode always resolves to the mode actually rendered 2026-08-20 15:10:15 +02:00
plain.go next release will be major version v5.x 2025-11-13 09:32:43 +01:00
quiet.go next release will be major version v5.x 2025-11-13 09:32:43 +01:00
spinner.go
tty.go chore: inline needless single-use helpers 2026-08-14 22:49:53 +02:00
tty_test.go fix(progress): measure taskID width in runes, not bytes 2026-06-15 15:00:57 +02:00