From adf29573f4d1f21dac7ae6f8fd8a14ab4c5228a2 Mon Sep 17 00:00:00 2001 From: Oliver Hartkopp Date: Tue, 28 Apr 2020 06:40:28 +0200 Subject: [PATCH] cansniffer: add interactive command to clear/redraw the screen For efficiency reasons on slow embedded machines cansniffer usually does not clear the screen but only writes updates on required lines. Sometimes the written lines exceed the terminal lines and people resize the window which is not detected by cansniffer. With entering in interactive mode the screen can be forced to redraw after resizing the terminal window. Signed-off-by: Oliver Hartkopp --- cansniffer.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cansniffer.c b/cansniffer.c index 41259fb..d65b6ec 100644 --- a/cansniffer.c +++ b/cansniffer.c @@ -166,6 +166,7 @@ void print_usage(char *prg) " 8 - toggle binary / HEX-ASCII output (small for EFF on 80 chars)\n" " B - toggle binary with gap / HEX-ASCII output (exceeds 80 chars!)\n" " c - toggle color mode\n" + " - force a clear screen\n" " # - notch currently marked/changed bits (can be used repeatedly)\n" " * - clear notched marked\n" " rMYNAME - read settings file (filter/notch)\n" @@ -492,6 +493,10 @@ int handle_keyb(int fd){ break; + case ' ' : + clearscreen = 1; + break; + case '#' : notch = 1; break;