dylanaraps / pure-sh-bible

📖 A collection of pure POSIX sh alternatives to external processes.
MIT License
6.45k stars 281 forks source link

"stty size" POSIX #26

Closed ghost closed 3 years ago

ghost commented 3 years ago

Hi Dylan, out of curiosity, haven't you found a POSIX way to get the size of the terminal?

cmplstofB commented 3 years ago

$COLUMNS and $LINES?

https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap08.html#tag_08_03

ghost commented 3 years ago

I'm all dumb, I didn't look at the variables 😔, excuse me, I'm learning to program in shell with "sh" following the POSIX standard, a few days ago I finished programming a password manager inspired by "pash", but my programming is not so good like Dylan's:

https://git.disroot.org/ricardog08/passgesh

Thank you very much for your answer.

dylanaraps commented 3 years ago

stty size is POSIX (very recent). See https://austingroupbugs.net/view.php?id=1053 and https://austingroupbugs.net/view.php?id=1151

cmplstofB commented 3 years ago

Oh, I didn’t know that (stty size). Thank you for telling!

ghost commented 3 years ago

Thanks Dylan