Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are the diffrences between `tput cols`, `tput lines` and `stty size`?

Tags:

terminal

Are there differences between tput cols, tput lines and stty size written in this way (apart that stty size returns all in one string)?

Is one more portable or more reliable than the other?

like image 931
sid_com Avatar asked Oct 16 '25 09:10

sid_com


1 Answers

At the moment I am asking myself the same question.

What I see on linux:

  • tput depends on ncurses
  • stty depends on coreutils and coreutils depends on ncurses

IMHO tput is more basic and portable.

like image 81
Massimo Avatar answered Oct 19 '25 12:10

Massimo



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!