Skip to content

Commit

Permalink
Disabling TERM_GRAPHICS for now
Browse files Browse the repository at this point in the history
  • Loading branch information
kenshaw committed Mar 28, 2024
1 parent dc5645d commit 4fac439
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
3 changes: 2 additions & 1 deletion env/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")))
Expand Down
24 changes: 13 additions & 11 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 4fac439

Please sign in to comment.