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 <SPACE><ENTER> in interactive mode the screen can be
forced to redraw after resizing the terminal window.

Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
pull/200/head
Oliver Hartkopp 2020-04-28 06:40:28 +02:00
parent bd6ef44321
commit adf29573f4
1 changed files with 5 additions and 0 deletions

View File

@ -166,6 +166,7 @@ void print_usage(char *prg)
" 8<ENTER> - toggle binary / HEX-ASCII output (small for EFF on 80 chars)\n"
" B<ENTER> - toggle binary with gap / HEX-ASCII output (exceeds 80 chars!)\n"
" c<ENTER> - toggle color mode\n"
" <SPACE><ENTER> - force a clear screen\n"
" #<ENTER> - notch currently marked/changed bits (can be used repeatedly)\n"
" *<ENTER> - clear notched marked\n"
" rMYNAME<ENTER> - read settings file (filter/notch)\n"
@ -492,6 +493,10 @@ int handle_keyb(int fd){
break;
case ' ' :
clearscreen = 1;
break;
case '#' :
notch = 1;
break;