Skip to content

Commit

Permalink
Merge pull request #1924 from BenTheElder/st-shrug
Browse files Browse the repository at this point in the history
disable smart output in st
  • Loading branch information
k8s-ci-robot authored Nov 13, 2020
2 parents 4cb70ab + 9062972 commit 59c2484
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 59c2484

Please sign in to comment.