parent
6dec26f9cc
commit
6e398ed6fb
|
|
@ -301,6 +301,8 @@ K9s uses aliases to navigate most K8s resources.
|
|||
crumbsless: false
|
||||
# Indicates whether modification commands like delete/kill/edit are disabled. Default is false
|
||||
readOnly: false
|
||||
# Toggles whether k9s should exit when CTRL-C is pressed. When set to true, you will need to exist k9s via the :quit command. Default is false.
|
||||
noExitOnCtrlC: false
|
||||
# Toggles icons display as not all terminal support these chars.
|
||||
noIcons: false
|
||||
# Logs configuration
|
||||
|
|
|
|||
|
|
@ -284,6 +284,7 @@ var expectedConfig = `k9s:
|
|||
logoless: false
|
||||
crumbsless: false
|
||||
readOnly: true
|
||||
noExitOnCtrlC: false
|
||||
noIcons: false
|
||||
logger:
|
||||
tail: 500
|
||||
|
|
@ -378,6 +379,7 @@ var resetConfig = `k9s:
|
|||
logoless: false
|
||||
crumbsless: false
|
||||
readOnly: false
|
||||
noExitOnCtrlC: false
|
||||
noIcons: false
|
||||
logger:
|
||||
tail: 200
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ type K9s struct {
|
|||
Logoless bool `yaml:"logoless"`
|
||||
Crumbsless bool `yaml:"crumbsless"`
|
||||
ReadOnly bool `yaml:"readOnly"`
|
||||
NoExitOnCtrlC bool `yaml:"noExitOnCtrlC"`
|
||||
NoIcons bool `yaml:"noIcons"`
|
||||
Logger *Logger `yaml:"logger"`
|
||||
CurrentContext string `yaml:"currentContext"`
|
||||
|
|
|
|||
|
|
@ -193,8 +193,12 @@ func (a *App) quitCmd(evt *tcell.EventKey) *tcell.EventKey {
|
|||
if a.InCmdMode() {
|
||||
return evt
|
||||
}
|
||||
a.BailOut()
|
||||
|
||||
if !a.Config.K9s.NoExitOnCtrlC {
|
||||
a.BailOut()
|
||||
}
|
||||
|
||||
// overwrite the default ctrl-c behavior of tview
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue