Compare commits

...
Author SHA1 Message Date
Will Murphy 4fb9970481 Prevent hang if stderr is tty but stdout is not
Previously, the rich TUI would be enabled if either stderr or stdout is
a TTY, but this could cause syft to hang if stderr was a TTY and stdout
was not, as in some cases of redirection.

Signed-off-by: Will Murphy <will.murphy@anchore.com>
2023-07-29 13:36:27 -04:00
+1 -1
View File
@@ -21,7 +21,7 @@ import (
func Select(verbose, quiet bool) (uis []clio.UI) {
isStdoutATty := term.IsTerminal(int(os.Stdout.Fd()))
isStderrATty := term.IsTerminal(int(os.Stderr.Fd()))
notATerminal := !isStderrATty && !isStdoutATty
notATerminal := !isStderrATty || !isStdoutATty
switch {
case runtime.GOOS == "windows" || verbose || quiet || notATerminal || !isStderrATty: