Skip to content

Commit

Permalink
disable smart output in st
Browse files Browse the repository at this point in the history
  • Loading branch information
BenTheElder committed Nov 12, 2020
1 parent e7d1a7d commit 9062972
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pkg/internal/env/term.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,13 @@ func isSmartTerminal(w io.Writer, GOOS string, lookupEnv func(string) (string, b

// Explicitly dumb terminals are not smart
// https://en.wikipedia.org/wiki/Computer_terminal#Dumb_terminals
if getenv("TERM") == "dumb" {
term := getenv("TERM")
if term == "dumb" {
return false
}
// st has some bug 🤷‍♂️
// https://github.com/kubernetes-sigs/kind/issues/1892
if term == "st-256color" {
return false
}

Expand Down
9 changes: 9 additions & 0 deletions pkg/internal/env/term_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,15 @@ func TestIsSmartTerminal(t *testing.T) {
IsSmart: false,
Writer: &testFakeTTY{},
},
{
Name: "tty, TERM=st-256color",
FakeEnv: map[string]string{
"TERM": "st-256color",
},
GOOS: "linux",
IsSmart: false,
Writer: &testFakeTTY{},
},
}
for _, tc := range cases {
tc := tc // capture tc
Expand Down

0 comments on commit 9062972

Please sign in to comment.