Blocker: no. This can wait. Do this with the Docker capability.
Defect
isInteractive (internal/docker/compose.go:15-18) examines only stdout. It uses os.ModeCharDevice.
/dev/null is a character device. Thus, isInteractive returns true for /dev/null. A test gave this result.
- Cron jobs frequently send output to
/dev/null. For these jobs, the CLI does not add -T to docker compose exec.
- The function does not examine stdin.
Cost
- With Docker Compose v5.1.1, a cron-style call with stdin and stdout on
/dev/null operated correctly. Thus, the effect is small on current Compose versions.
- The effect on older Compose versions is not known.
Benefit of the fix
- The CLI identifies a terminal correctly in all conditions.
- The behavior does not depend on the Compose version.
Fix
Use go-isatty on stdin and stdout. go-isatty is already in the dependency tree.
Blocker: no. This can wait. Do this with the Docker capability.
Defect
isInteractive(internal/docker/compose.go:15-18) examines only stdout. It usesos.ModeCharDevice./dev/nullis a character device. Thus,isInteractivereturnstruefor/dev/null. A test gave this result./dev/null. For these jobs, the CLI does not add-Ttodocker compose exec.Cost
/dev/nulloperated correctly. Thus, the effect is small on current Compose versions.Benefit of the fix
Fix
Use
go-isattyon stdin and stdout.go-isattyis already in the dependency tree.