This commit is contained in:
dev_Hakaze 2026-08-04 18:41:34 +04:00 committed by GitHub
commit 96a0fbb4d8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -353,8 +353,13 @@ func runTUI(path string, content string) error {
return fmt.Errorf("error parsing config: %v", err)
}
// use style set in env, or auto if unset
if err := validateStyle(cfg.GlamourStyle); err != nil {
// Prefer CLI/config style (resolved in validateOptions) when it is not
// the default "auto". Otherwise fall back to GLAMOUR_STYLE from the
// environment, then to auto. Previously an env value such as "auto" or
// "dark" silently ignored `-s light` / config `style` in TUI mode (#953).
if style != styles.AutoStyle {
cfg.GlamourStyle = style
} else if err := validateStyle(cfg.GlamourStyle); err != nil || cfg.GlamourStyle == "" {
cfg.GlamourStyle = style
}