on 94de6bc help sign in
15 lines 391 B history raw
1package term
3import (
4 "os"
5 "strings"
6)
8// SupportsProgressBar tries to determine whether the current terminal supports
9// progress bars by looking into environment variables.
10func SupportsProgressBar() bool {
11 termProg := os.Getenv("TERM_PROGRAM")
12 _, isWindowsTerminal := os.LookupEnv("WT_SESSION")
14 return isWindowsTerminal || strings.Contains(strings.ToLower(termProg), "ghostty")