3 ms·
> If this particular API has been stable Well, it hasn't. The tcgetwinsize() was proposed (under this name) in 2017 and was standardized only in 2024. So it's
by Joker_vD 2y ago
> If this particular API has been stable
Well, it hasn't. The tcgetwinsize() was proposed (under this name) in 2017 and was standardized only in 2024. So it's less than a 10 year old API, which is missing from lots of libc implementations, see e.g. [0]. Before its appearance, you had to mess with doing ioctl's and hoping your libc has exposed the TIOCGWINSZ constant (which glibc by default didn't).
[0] https://www.gnu.org/software/gnulib/manual/html_node/tcgetwinsize.html https://www.gnu.org/software/gnulib/manual/html_node/tcgetwi...
- mrweasel 2y agoI had to check the Rustix implementation again, because that would indicate that that terminal-size wouldn't work on a number of operating systems. However Rustix also uses TIOCGWINSZ in it's tcgetwinsize implementation.