Skip to content
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

3052: clean exit #3075

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

KevinGimbel
Copy link

A wrong TERM value can cause k9s to crash, instead of crashing we can log a warning and silently set the variable for the duration of k9s' execution with os.Setenv. We recommend setting this variable in the README.md anyway (during the Preflight checks)

I've tested it with MacOS and would like to test on Linux as well.

How to test

Set TERM to xterm-ghostty

export TERM=xterm-ghostty

Run k9s, it panics:

k9s
panic: exit status 1

goroutine 1 [running]:
github.com/derailed/k9s/cmd.Execute()
        github.com/derailed/k9s/cmd/root.go:72 +0x80
main.main()

Run this branch, it works:

go run main.go
WARN: $TERM must be set to 'xterm-256color', got 'xterm-ghostty'
<k9s starts normally>

Set TERM variable if it is anything but xterm-256color,
this prevents panics and crashes, and logs a warning as well.

Updates derailed#3052
@KevinGimbel
Copy link
Author

I accidentally added a WIP from another local branch to this PR, which I reverted again. I can also scrap and re-create the entire PR / branch if needed. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant