Skip to main content
7 events
when toggle format what by license comment
Oct 3, 2021 at 17:48 comment added john-jones Second solution doesn't work on my system. First line gives me a number but I can zoom into the terminal (ctrl - shfit - +) and the number doesn't change. But number of lines visible on the terminal definitely does. I'm using linux mint, xfce, bash.
Feb 11, 2015 at 3:28 comment added Celada @Costas actually, frustratingly, neither my command nor either one of yours worked on MacOS, so I had to come up with yet a different command (edited). Go figure: MacOS emits "24 rows" instead of "rows 24"! I still think tput lines is way better, and I think it's pretty portable!
Feb 11, 2015 at 3:26 history edited Celada CC BY-SA 3.0
deleted 5 characters in body
Feb 10, 2015 at 18:48 comment added Costas I'd like to offer substitute long pipe with stty -a by something like grep -Po 'rows \K[^;]*' or sed -n 's/.*rows \([^;]*\).*/\1/p'
Feb 10, 2015 at 13:57 comment added Celada I was afraid that the first one might be OS specific, which is why I added the second one. Indeed after a little bit of Googling I see that the first one probably won't work on Solaris. The second one should be very portable. Honestly, @Costas' tput lines seems like the better answer and I have upvoted it. I didn't know about it before.
Feb 10, 2015 at 13:52 comment added Warren Young This seems very OS-specific. Can you compile the list of systems where each incantation works?
Feb 10, 2015 at 13:28 history answered Celada CC BY-SA 3.0