File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -16,13 +16,15 @@ package spin
16
16
17
17
import (
18
18
"io"
19
+ "os"
19
20
"os/exec"
20
21
"strings"
21
22
"syscall"
22
23
"time"
23
24
24
25
"github.com/charmbracelet/gum/internal/exit"
25
26
"github.com/charmbracelet/gum/timeout"
27
+ "github.com/charmbracelet/x/term"
26
28
27
29
"github.com/charmbracelet/bubbles/spinner"
28
30
tea "github.com/charmbracelet/bubbletea"
@@ -68,8 +70,12 @@ func commandStart(command []string) tea.Cmd {
68
70
}
69
71
70
72
executing = exec .Command (command [0 ], args ... ) //nolint:gosec
71
- executing .Stdout = io .MultiWriter (& bothbuf , & outbuf )
72
- executing .Stderr = io .MultiWriter (& bothbuf , & errbuf )
73
+ if term .IsTerminal (os .Stdout .Fd ()) {
74
+ executing .Stdout = io .MultiWriter (& bothbuf , & outbuf )
75
+ executing .Stderr = io .MultiWriter (& bothbuf , & errbuf )
76
+ } else {
77
+ executing .Stdout = os .Stdout
78
+ }
73
79
_ = executing .Run ()
74
80
status := executing .ProcessState .ExitCode ()
75
81
if status == - 1 {
You can’t perform that action at this time.
0 commit comments