ad-si / TaskLite

The CLI task manager for power users
https://tasklite.org
GNU Affero General Public License v3.0
216 stars 12 forks source link

Getting default headCount using tput #39

Open jnduli opened 3 years ago

jnduli commented 3 years ago

While using a floating window, the default of 20 leads to an overflow, where I can't see all the tasks with tasklite ready because I have a limit of 18 lines.

╭─rookie@archlinux ~ 
╰─$ echo $LINES
18

I think the command tput lines can be used to set the default headCount. Something like this in ghci:

Prelude> import System.Process
Prelude System.Process> z = readProcess "tput" ["lines"] ""
Prelude System.Process> z
"18\n"

and then set that value as the default headCount.

ad-si commented 3 years ago

Very good idea! I'l look into this.

jnduli commented 3 years ago

Cool, for the moment, I've been using tl | head -n $(($LINES - 3))