I\'ve been looking for a way to get the terminal width from within my C program. What I keep coming up with is something along the lines of:
#include
So not suggesting an answer here, but:
linux-pc:~/scratch$ echo $LINES
49
linux-pc:~/scratch$ printenv | grep LINES
linux-pc:~/scratch$
Ok, and I notice that if I resize the GNOME terminal, the LINES and COLUMNS variables follow that.
Kinda seems like GNOME terminal is creating these environment variables itself?