Terminal control/Dimensions: Difference between revisions

Content added Content deleted
m (→‎{{header|UNIX Shell}}: <lang bash>, not <lang sh>.)
(→‎{{libheader|BSD libc}}: 4.4BSD has TIOCGWINSZ. Older BSD might or might not have it, but this program also uses err() from 4.4BSD.)
Line 11: Line 11:
Almost all terminal devices can do NAWS (Negotiate About Window Size). A terminal emulator like xterm(1) should set the size. A network server like sshd(1) should copy the size from its client. Other devices, such as plain serial ports, might not know the window size.
Almost all terminal devices can do NAWS (Negotiate About Window Size). A terminal emulator like xterm(1) should set the size. A network server like sshd(1) should copy the size from its client. Other devices, such as plain serial ports, might not know the window size.


{{works with|OpenBSD|4.9}}
{{works with|BSD|4.4}}
<lang c>#include <sys/ioctl.h> /* ioctl, TIOCGWINSZ */
<lang c>#include <sys/ioctl.h> /* ioctl, TIOCGWINSZ */
#include <err.h> /* err */
#include <err.h> /* err */