Skip to content

Commit 4fac439

Browse files
committed
Disabling TERM_GRAPHICS for now
1 parent dc5645d commit 4fac439

File tree

2 files changed

+15
-12
lines changed

2 files changed

+15
-12
lines changed

env/env.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,8 @@ func Unquote(u *user.User, exec bool, v Vars) func(string, bool) (bool, string,
324324
}
325325
}
326326

327-
// TermGraphics returns the [rasterm.TermType] based on
327+
// TermGraphics returns the [rasterm.TermType] based on TERM_GRAPHICS
328+
// environment variable.
328329
func TermGraphics() rasterm.TermType {
329330
var typ rasterm.TermType
330331
_ = typ.UnmarshalText([]byte(Get("TERM_GRAPHICS")))

main.go

+13-11
Original file line numberDiff line numberDiff line change
@@ -86,18 +86,20 @@ func run(args *Args, u *user.User) error {
8686
cygwin := isatty.IsCygwinTerminal(os.Stdout.Fd()) && isatty.IsCygwinTerminal(os.Stdin.Fd())
8787
forceNonInteractive := len(args.CommandOrFiles) != 0
8888
// enable term graphics
89-
if !forceNonInteractive && interactive && !cygwin {
90-
// NOTE: this is done here and not in the env.init() package, because
91-
// NOTE: we need to determine if it is interactive first, otherwise it
92-
// NOTE: could mess up the non-interactive output with control characters
93-
var typ string
94-
if s, _ := env.Getenv(text.CommandUpper()+"_TERM_GRAPHICS", "TERM_GRAPHICS"); s != "" {
95-
typ = s
96-
}
97-
if err := env.Set("TERM_GRAPHICS", typ); err != nil {
98-
return err
89+
/*
90+
if !forceNonInteractive && interactive && !cygwin {
91+
// NOTE: this is done here and not in the env.init() package, because
92+
// NOTE: we need to determine if it is interactive first, otherwise it
93+
// NOTE: could mess up the non-interactive output with control characters
94+
var typ string
95+
if s, _ := env.Getenv(text.CommandUpper()+"_TERM_GRAPHICS", "TERM_GRAPHICS"); s != "" {
96+
typ = s
97+
}
98+
if err := env.Set("TERM_GRAPHICS", typ); err != nil {
99+
return err
100+
}
99101
}
100-
}
102+
*/
101103
// handle variables
102104
for _, v := range args.Variables {
103105
if i := strings.Index(v, "="); i != -1 {

0 commit comments

Comments
 (0)