{"record":{"id":"d93437bc6264456d","repo":"docker/compose","slug":"can-t-use-progress-tty-while-ansi-support-is-dis","errorCode":null,"errorMessage":"can't use --progress tty while ANSI support is disabled","messagePattern":"can't use --progress tty while ANSI support is disabled","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/compose/compose.go","lineNumber":670,"sourceCode":"//\n// In auto mode we probe Err() (not Out()) because the renderer writes to stderr;\n// probing stdout would force plain mode whenever stdout is redirected (e.g.\n// `docker compose up | tee log`) while stderr is still a terminal.\nfunc selectEventProcessor(dockerCli command.Cli, progress, ansi string, detached bool) (api.EventProcessor, error) {\n\tswitch progress {\n\tcase \"\", display.ModeAuto:\n\t\tswitch {\n\t\tcase ansi == \"never\":\n\t\t\tdisplay.Mode = display.ModePlain\n\t\t\treturn display.Plain(dockerCli.Err()), nil\n\t\tcase dockerCli.Err().IsTerminal():\n\t\t\treturn display.Full(dockerCli.Err(), stdinfo(dockerCli), detached), nil\n\t\tdefault:\n\t\t\treturn display.Plain(dockerCli.Err()), nil\n\t\t}\n\tcase display.ModeTTY:\n\t\tif ansi == \"never\" {\n\t\t\treturn nil, fmt.Errorf(\"can't use --progress tty while ANSI support is disabled\")\n\t\t}\n\t\tdisplay.Mode = display.ModeTTY\n\t\treturn display.Full(dockerCli.Err(), stdinfo(dockerCli), detached), nil\n\tcase display.ModePlain:\n\t\tif ansi == \"always\" {\n\t\t\treturn nil, fmt.Errorf(\"can't use --progress plain while ANSI support is forced\")\n\t\t}\n\t\tdisplay.Mode = display.ModePlain\n\t\treturn display.Plain(dockerCli.Err()), nil\n\tcase display.ModeQuiet, \"none\":\n\t\tdisplay.Mode = display.ModeQuiet\n\t\treturn display.Quiet(), nil\n\tcase display.ModeJSON:\n\t\tdisplay.Mode = display.ModeJSON\n\t\tlogrus.SetFormatter(&logrus.JSONFormatter{})\n\t\treturn display.JSON(dockerCli.Err()), nil\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"unsupported --progress value %q\", progress)","sourceCodeStart":652,"sourceCodeEnd":688,"githubUrl":"https://github.com/docker/compose/blob/ddc4b044b62e9f715212ea4143fa830fac76382f/cmd/compose/compose.go#L652-L688","documentation":"The TTY progress renderer draws with ANSI escape sequences. If ANSI output is explicitly disabled (docker --ansi never / CLI ANSI=never env) while --progress tty is requested, the two settings conflict and compose refuses rather than emitting broken control codes to a non-ANSI terminal.","triggerScenarios":"Running `docker --ansi never compose up --progress tty`, or having DOCKER_CLI_ANSI=never / running in an environment that disables ANSI, combined with --progress tty (or COMPOSE_PROGRESS=tty).","commonSituations":"CI systems that disable ANSI globally for clean logs but a script forces --progress tty; minimal terminals (plain serial consoles, some Windows shells) where ansi=never was set; copy-pasted commands mixing --ansi never and --progress tty.","solutions":["Use `--progress auto` or `--progress plain` when ANSI is disabled","Re-enable ANSI (drop `--ansi never` / unset the ANSI env) if your terminal does support it","In CI, prefer `--progress plain` for parseable logs regardless of ANSI settings"],"exampleFix":"# before\ndocker --ansi never compose build --progress tty\n# after\ndocker --ansi never compose build --progress plain","handlingStrategy":"validation","validationCode":"# reconcile progress mode with ANSI setting before running\nansi=\"${DOCKER_CLI_ANSI:-auto}\"\nprogress=\"${COMPOSE_PROGRESS:-auto}\"\nif [ \"$ansi\" = never ] && [ \"$progress\" = tty ]; then export COMPOSE_PROGRESS=plain; fi\ndocker compose build","typeGuard":null,"tryCatchPattern":null,"preventionTips":["In CI and non-ANSI terminals default to --progress plain","Do not combine --ansi never with --progress tty in copied commands"],"tags":["progress","ansi","tty","cli"],"backgroundTag":null,"analyzedSha":"ddc4b044b62e9f715212ea4143fa830fac76382f","analyzedAt":"2026-08-15T13:31:42.319Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}