save config when closing k9s with ctrl-c (#2666)

mine
Jayson Wang 2024-05-03 21:31:35 +08:00 committed by GitHub
parent e8fbbc1194
commit a0ffa8f392
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 0 deletions

View File

@ -151,6 +151,10 @@ func (a *App) bindKeys() {
// BailOut exits the application. // BailOut exits the application.
func (a *App) BailOut() { func (a *App) BailOut() {
if err := a.Config.Save(true); err != nil {
log.Error().Err(err).Msg("config save failed!")
}
a.Stop() a.Stop()
os.Exit(0) os.Exit(0)
} }