From 2f17a9d6894adbc6259cef64f656bc38c1182afd Mon Sep 17 00:00:00 2001 From: Bradley Cicenas Date: Thu, 9 Mar 2017 05:29:34 +0000 Subject: [PATCH] add ctrl+c exit handler --- grid.go | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/grid.go b/grid.go index c2cb386..fa28653 100644 --- a/grid.go +++ b/grid.go @@ -77,17 +77,16 @@ func Display() bool { cursor.RefreshContainers() RedrawRows(true) - ui.Handle("/sys/kbd/", func(ui.Event) { - cursor.Up() - }) - ui.Handle("/sys/kbd/", func(ui.Event) { - cursor.Down() - }) + ui.Handle("/sys/kbd/", func(ui.Event) { cursor.Up() }) + ui.Handle("/sys/kbd/", func(ui.Event) { cursor.Down() }) ui.Handle("/sys/kbd/", func(ui.Event) { expand = true ui.StopLoop() }) + ui.Handle("/sys/kbd/q", func(ui.Event) { ui.StopLoop() }) + ui.Handle("/sys/kbd/C-c", func(ui.Event) { ui.StopLoop() }) + ui.Handle("/sys/kbd/a", func(ui.Event) { config.Toggle("allContainers") RefreshDisplay() @@ -107,9 +106,6 @@ func Display() bool { config.Toggle("enableHeader") RedrawRows(true) }) - ui.Handle("/sys/kbd/q", func(ui.Event) { - ui.StopLoop() - }) ui.Handle("/sys/kbd/r", func(e ui.Event) { config.Toggle("sortReversed") })