diff --git a/env/env.go b/env/env.go index 9b05ce8bbd6..fc618c41728 100644 --- a/env/env.go +++ b/env/env.go @@ -324,7 +324,8 @@ func Unquote(u *user.User, exec bool, v Vars) func(string, bool) (bool, string, } } -// TermGraphics returns the [rasterm.TermType] based on +// TermGraphics returns the [rasterm.TermType] based on TERM_GRAPHICS +// environment variable. func TermGraphics() rasterm.TermType { var typ rasterm.TermType _ = typ.UnmarshalText([]byte(Get("TERM_GRAPHICS"))) diff --git a/main.go b/main.go index 9a4f53ccdf0..2489cd25263 100644 --- a/main.go +++ b/main.go @@ -86,18 +86,20 @@ func run(args *Args, u *user.User) error { cygwin := isatty.IsCygwinTerminal(os.Stdout.Fd()) && isatty.IsCygwinTerminal(os.Stdin.Fd()) forceNonInteractive := len(args.CommandOrFiles) != 0 // enable term graphics - if !forceNonInteractive && interactive && !cygwin { - // NOTE: this is done here and not in the env.init() package, because - // NOTE: we need to determine if it is interactive first, otherwise it - // NOTE: could mess up the non-interactive output with control characters - var typ string - if s, _ := env.Getenv(text.CommandUpper()+"_TERM_GRAPHICS", "TERM_GRAPHICS"); s != "" { - typ = s - } - if err := env.Set("TERM_GRAPHICS", typ); err != nil { - return err + /* + if !forceNonInteractive && interactive && !cygwin { + // NOTE: this is done here and not in the env.init() package, because + // NOTE: we need to determine if it is interactive first, otherwise it + // NOTE: could mess up the non-interactive output with control characters + var typ string + if s, _ := env.Getenv(text.CommandUpper()+"_TERM_GRAPHICS", "TERM_GRAPHICS"); s != "" { + typ = s + } + if err := env.Set("TERM_GRAPHICS", typ); err != nil { + return err + } } - } + */ // handle variables for _, v := range args.Variables { if i := strings.Index(v, "="); i != -1 {