mirror of
https://github.com/docker/compose.git
synced 2026-10-12 02:13:08 +00:00
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 <[email protected]>