@@ -2,7 +2,6 @@ package spinner
22
33import (
44 "math/rand/v2"
5- "os"
65 "strings"
76
87 tea "charm.land/bubbletea/v2"
@@ -138,37 +137,7 @@ func (s *spinner) Stop() {
138137}
139138
140139// spinnerFrames holds the animation frames for the current terminal.
141- // Braille characters are used by default; inside tmux they don't render
142- // correctly, so we fall back to ASCII.
143- var spinnerFrames = selectFrames (inMultiplexer ())
144-
145- // inMultiplexer reports whether the process is running inside a terminal
146- // multiplexer (tmux, screen). Detection checks multiple env vars because
147- // some of them may be stripped in containers or sudo sessions.
148- func inMultiplexer () bool {
149- if os .Getenv ("TMUX" ) != "" {
150- return true
151- }
152- if os .Getenv ("STY" ) != "" { // GNU screen
153- return true
154- }
155- term := os .Getenv ("TERM" )
156- return strings .HasPrefix (term , "tmux" ) || strings .HasPrefix (term , "screen" )
157- }
158-
159- var (
160- brailleFrames = []string {"⠋" , "⠙" , "⠹" , "⠸" , "⠼" , "⠴" , "⠦" , "⠧" , "⠇" , "⠏" }
161- asciiFrames = []string {"|" , "/" , "-" , "\\ " }
162- )
163-
164- // selectFrames returns ASCII spinner frames when inTmux is true,
165- // braille frames otherwise.
166- func selectFrames (inTmux bool ) []string {
167- if inTmux {
168- return asciiFrames
169- }
170- return brailleFrames
171- }
140+ var spinnerFrames = []string {"⠋" , "⠙" , "⠹" , "⠸" , "⠼" , "⠴" , "⠦" , "⠧" , "⠇" , "⠏" }
172141
173142// Frame returns the spinner character for the given animation frame.
174143func Frame (index int ) string {
0 commit comments