cheat.sh icon indicating copy to clipboard operation
cheat.sh copied to clipboard

Also use pager for normal queries (but skip paging when output is not to a terminal)

Open inkarkat opened this issue 3 years ago • 0 comments

I don't use --shell very much, rather ad-hoc cht.sh <query> in the shell. The paging that is used in shell mode would be helpful there as well, to avoid scrolling back in the terminal when there's long output. The existing do_query() function that is used in shell mode looks like it can be a drop-in replacement for the duplicated curl calls, and with that we get paging for normal queries as well. (And this reuses any set session id as well.) Some initializations need to be moved further up; they still don't run for --help, --mode, and --standalone-install.

inkarkat avatar Jun 17 '21 19:06 inkarkat