Skip to content

fix: --no-color CLI flag not consulted by TUI wizard #15

@MacAttak

Description

@MacAttak

Problem

isColorDisabled() only checks NO_COLOR and CI environment variables and is evaluated once at BuildRootCommand() time. The --no-color persistent flag registered in root.go is never consulted, so passing --no-color on the CLI has no effect on the wizard's accessible mode.

Context

Raised in PR #14 review (comment). Deferred because the fix requires changing Wizard.Run to accept the accessible setting lazily (or accept a func), which widens scope.

Suggested fix

Check --no-color inside runInit after Cobra has parsed flags, and pass it to the wizard:

// In runInit, after parsing flags:
noColor, _ := cmd.Flags().GetBool("no-color")
wizResult, err := cfg.Wizard.Run(cmd.Context(), isColorDisabled() || noColor)

This requires updating the initWizard interface and Wizard.Run signature.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions