A program's stderr may have been redirected by the operator. We want to
query the size of stdout, even though it is buffered, so add fflush() to
handle that.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
Programs that may be called in the background or with the stdin/stdout
redirected are not proper TTYs and we should not try to perform any
tricks on them. This patch checks isatty() and returns standard term
sizes as a fallback.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This patch adds a very simple progress bar I wrote once. It's revision
f98c5d0 from https://github.com/troglobit/toolbox
Also included in this patch is conio.h, a neat little set of macros for
manipulating your terminal using ANSI escape seequences.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>