The command for closing the application is now customizable. It is CtrlC by default.
MODIFY
shortcuts/shortcuts.go
shortcuts/shortcuts.go
@@ -19,6 +19,14 @@ var (
Name: "Application wide",
}
+ ExitApplication = &Shortcut{
+ Name: "Exit application",
+ Identifier: "exit_application",
+ scope: globalScope,
+ Event: tcell.NewEventKey(tcell.KeyCtrlC, rune(tcell.KeyCtrlC), tcell.ModCtrl),
+ defaultEvent: tcell.NewEventKey(tcell.KeyCtrlC, rune(tcell.KeyCtrlC), tcell.ModCtrl),
+ }
+
FocusChannelContainer = &Shortcut{
Name: "Focus channel container",
Identifier: "focus_channel_container",
@@ -127,6 +135,7 @@ var (
}
Shortcuts = []*Shortcut{
+ ExitApplication,
FocusChannelContainer,
FocusUserContainer,
ToggleUserContainer,

MODIFY
ui/window.go
ui/window.go
@@ -1548,9 +1548,16 @@ func (window *Window) SetCommandModeEnabled(enabled bool) {
}
func (window *Window) handleGlobalShortcuts(event *tcell.EventKey) *tcell.EventKey {
- if event.Key() == tcell.KeyCtrlC {
+ if shortcuts.EventsEqual(shortcuts.ExitApplication.Event, event) {
window.doRestart <- false
- return event
+ window.app.Stop()
+ return nil
+ }
+
+ // If `ExitApplication` isn't the default (CtrlC) anymore, then we ignore
+ // CtrlC, as it is hardcoded in tview.
+ if event.Key() == tcell.KeyCtrlC {
+ return nil
}
// Maybe compare directly to table?

The command for closing the application is now customizable. It is CtrlC by default.