perf top browser: Fix up exit keys

The left key was exiting 'perf top --tui' when it really shouldn't, it
was too easy to leave the live annotation window and then press one too
many <- and get out of the tool altogether.

Do just like the report TUI does, ignore the left key for exit and also
ask the user when pressing ESC if that is really what is wanted.
Reported-by: default avatarMike Galbraith <efault@gmx.de>
Suggested-by: default avatarIngo Molnar <mingo@elte.hu>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Tom Zanussi <tzanussi@gmail.com>
LKML-Reference: <new-submission>
Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 170ae6bc
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
#include "../../annotate.h" #include "../../annotate.h"
#include "../helpline.h" #include "../helpline.h"
#include "../libslang.h" #include "../libslang.h"
#include "../util.h"
#include "../../evlist.h" #include "../../evlist.h"
#include "../../hist.h" #include "../../hist.h"
#include "../../sort.h" #include "../../sort.h"
...@@ -174,6 +175,12 @@ static int perf_top_browser__run(struct perf_top_browser *browser) ...@@ -174,6 +175,12 @@ static int perf_top_browser__run(struct perf_top_browser *browser)
if (browser->selection) if (browser->selection)
perf_top_browser__annotate(browser); perf_top_browser__annotate(browser);
break; break;
case NEWT_KEY_LEFT:
continue;
case NEWT_KEY_ESCAPE:
if (!ui__dialog_yesno("Do you really want to exit?"))
continue;
/* Fall thru */
default: default:
goto out; goto out;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment