Skip to content

Commit

Permalink
fix: use new tty pkg
Browse files Browse the repository at this point in the history
  • Loading branch information
caarlos0 committed Dec 13, 2024
1 parent 118ad7e commit 0823983
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions choose/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@ import (
tea "github.com/charmbracelet/bubbletea"
"github.com/charmbracelet/gum/internal/stdin"
"github.com/charmbracelet/gum/internal/timeout"
"github.com/charmbracelet/gum/internal/tty"
"github.com/charmbracelet/lipgloss"
"github.com/charmbracelet/x/ansi"
"github.com/charmbracelet/x/term"
)

// Run provides a shell script interface for choosing between different through
Expand Down Expand Up @@ -153,12 +152,6 @@ func (o Options) Run() error {
out = append(out, item.text)
}
}

if term.IsTerminal(os.Stdout.Fd()) {
fmt.Println(strings.Join(out, o.OutputDelimiter))
} else {
fmt.Println(ansi.Strip(strings.Join(out, o.OutputDelimiter)))
}

tty.Println(strings.Join(out, o.OutputDelimiter))
return nil
}

0 comments on commit 0823983

Please sign in to comment.