summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2023-01-11 16:42:14 -0800
committerVito Caputo <vcaputo@pengaru.com>2023-01-11 22:31:31 -0800
commit0805372ed5460cf4a886e04bf65a5895413463a3 (patch)
treeb76f1de370a9a36198c6113c08d2f8daa2206188 /src
parent6153122a24e847ade9c9d2b84ef8dd125e2a772b (diff)
main: experimenting with ANSI codes for --print-pipes
This turns --print-pipes into a more top-like display. Redirect the FPS on stderr somewhere else to get less flickering e.g. 2>/dev/null pipes print to stdout.
Diffstat (limited to 'src')
-rw-r--r--src/main.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/main.c b/src/main.c
index 37fef55..2e0229e 100644
--- a/src/main.c
+++ b/src/main.c
@@ -336,8 +336,10 @@ static void * rototiller_thread(void *_rt)
til_module_render(rt->module_context, rt->stream, ticks, &fragment);
til_fb_fragment_submit(fragment);
- if (rt->args.print_pipes) /* render threads are idle at this point */
+ if (rt->args.print_pipes) { /* render threads are idle at this point */
+ printf("\x1b[2J\x1b[;H"); /* ANSI codes for clear screen and move cursor to top left */
til_stream_fprint(rt->stream, stdout);
+ }
}
return NULL;
© All Rights Reserved