From 6c10312c7561d9872fcf5338e18f0a05624551da Mon Sep 17 00:00:00 2001 From: Keith Goldfarb Date: Sat, 24 Mar 2018 10:55:20 -0700 Subject: [PATCH] ncdu: added a "refresh" key - for #2174 Added Control+L key to refresh screen. Not sure if this is the best choice, but it appears to be somewhat common. --- cmd/ncdu/ncdu.go | 9 +++++++++ docs/content/commands/rclone_ncdu.md | 1 + 2 files changed, 10 insertions(+) diff --git a/cmd/ncdu/ncdu.go b/cmd/ncdu/ncdu.go index 0412bb05b..389c03ed0 100644 --- a/cmd/ncdu/ncdu.go +++ b/cmd/ncdu/ncdu.go @@ -64,6 +64,7 @@ var helpText = []string{ " c toggle counts", " g toggle graph", " n,s,C sort by name,size,count", + " ^L refresh screen", " ? to toggle help on and off", " q/ESC/c-C to quit", } @@ -539,6 +540,14 @@ outer: u.toggleSort(&u.sortByCount) case '?': u.togglePopupBox(helpText) + + // Refresh the screen. Not obvious what key to map + // this onto, but ^L is a common choice. + case termbox.KeyCtrlL: + err := termbox.Sync() + if err != nil { + fs.Errorf(nil, "termbox sync returned error: %v", err) + } } } } diff --git a/docs/content/commands/rclone_ncdu.md b/docs/content/commands/rclone_ncdu.md index 35ae0e4e9..e2943aa8c 100644 --- a/docs/content/commands/rclone_ncdu.md +++ b/docs/content/commands/rclone_ncdu.md @@ -30,6 +30,7 @@ Here are the keys - press '?' to toggle the help on and off c toggle counts g toggle graph n,s,C sort by name,size,count + ^L refresh screen ? to toggle help on and off q/ESC/c-C to quit