Jump to content

Terminal control/Dimensions: Difference between revisions

→‎{{libheader|BSD libc}}: 4.4BSD has TIOCGWINSZ. Older BSD might or might not have it, but this program also uses err() from 4.4BSD.
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:
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|OpenBSDBSD|4.94}}
<lang c>#include <sys/ioctl.h> /* ioctl, TIOCGWINSZ */
#include <err.h> /* err */
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.