Skip to content

Commit a5a8b81

Browse files
committed
add full screen refresh with ^L
1 parent a13d396 commit a5a8b81

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,7 @@ when reading data from a pipe, ttyplot accepts the following commands typed at t
258258
```
259259
q quit
260260
r toggle rate mode
261+
^L full screen redraw
261262
```
262263

263264
these commands do not work if the standard input is a terminal: in this case quit with <kbd>Ctrl</kbd>-<kbd>C</kbd>.

ttyplot.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,8 @@ static void usage(void) {
146146
"\n"
147147
"Hotkeys:\n"
148148
" q quit\n"
149-
" r toggle rate mode\n");
149+
" r toggle rate mode\n"
150+
" ^L full screen refresh\n");
150151
}
151152

152153
static void version(void) {
@@ -955,6 +956,10 @@ int main(int argc, char *argv[]) {
955956
rate = ! rate;
956957
else if (key == 'q') // 'q' = quit
957958
break;
959+
else if (key == '\f' || key == 12) { // Ctrl+L = full screen refresh
960+
clear();
961+
redraw_needed = true;
962+
}
958963
} else if (count == 0) {
959964
close(tty);
960965
tty = -1;

0 commit comments

Comments
 (0)