mirror of
https://github.com/charmbracelet/gum
synced 2024-06-09 01:02:17 +02:00
(fix): ShowOutput flag works as intended
Fixes the `--show-output` flag not piping output. Fixes the `--show-output` flag not showing live output.
This commit is contained in:
parent
a63ea30136
commit
d66af4f082
|
@ -26,6 +26,7 @@ func (o Options) Run() error {
|
|||
title: o.TitleStyle.ToLipgloss().Render(o.Title),
|
||||
command: o.Command,
|
||||
align: o.Align,
|
||||
showOutput: o.ShowOutput && isTTY,
|
||||
timeout: o.Timeout,
|
||||
hasTimeout: o.Timeout > 0,
|
||||
}
|
||||
|
@ -46,7 +47,7 @@ func (o Options) Run() error {
|
|||
}
|
||||
|
||||
if o.ShowOutput {
|
||||
if isTTY {
|
||||
if !isTTY {
|
||||
_, err := os.Stdout.WriteString(m.stdout)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to write to stdout: %w", err)
|
||||
|
|
Loading…
Reference in a new issue