From 0823983db063b207f31a415623b2f6546d5d4414 Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Fri, 13 Dec 2024 17:02:58 -0300 Subject: [PATCH] fix: use new tty pkg --- choose/command.go | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/choose/command.go b/choose/command.go index 34cd2d89e..92a57526d 100644 --- a/choose/command.go +++ b/choose/command.go @@ -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 @@ -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 }