Skip to content

3052: clean exit #3075

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 5 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,14 @@ func init() {
fmt.Printf("Fail to init k9s logs location %s\n", err)
}

// wrong TERM variables can cause panics. See https://github.com/derailed/k9s/issues/3052
// k9s requires xterm-256color to be set as per the README.md file
if term := os.Getenv("TERM"); term != "xterm-256color" {
fmt.Printf("WARN: $TERM must be set to 'xterm-256color', got '%s'\n", term)
fmt.Printf("Please see the documentation at https://github.com/derailed/k9s#preflight-checks\n")
os.Exit(1)
}

rootCmd.SetFlagErrorFunc(func(command *cobra.Command, err error) error {
return flagError{err: err}
})
Expand Down