Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
wrong LINES, COLUMNS
- X-seq: zsh-users 6049
- From: koen.van_hoo1@xxxxxxxxx
- To: zsh-users@xxxxxxxxxx
- Subject: wrong LINES, COLUMNS
- Date: Fri, 25 Apr 2003 16:54:37 +0200 (MET DST)
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
Hi,
Recently it did install some patches on our servers, which caused
ioctl(SHTTY, TIOCGWINSZ, (char *)&shttyinfo.winsize)
to return an error.
In that case ws_row and ws_col in shttyinfo.winsize are set to 0 in Src/utils.c,
and a lot off tools like vi, more, less, ... don't work properly anymore.
If it was changed into
=======================================
#ifdef TIOCGWINSZ
if (SHTTY == -1)
return;
if (ioctl(SHTTY, TIOCGWINSZ, (char *)&shttyinfo.winsize) == 0) {
resetzle = (ttyrows != shttyinfo.winsize.ws_row ||
ttycols != shttyinfo.winsize.ws_col);
if (from == 0 && resetzle && ttyrows && ttycols)
from = 1; /* Signal missed while a job owned the tty? */
ttyrows = shttyinfo.winsize.ws_row;
ttycols = shttyinfo.winsize.ws_col;
} else {
/* Set to unknown on failure */
shttyinfo.winsize.ws_row = lines;
shttyinfo.winsize.ws_col = columns;
resetzle = from == 1;
}
#else
resetzle = from == 1;
#endif /* TIOCGWINSZ */
==========================================
it is possible to set LINES and COLUMNS from the commandline, and have vi, less, more, ...
to work just fin.
-- Koen
Messages sorted by:
Reverse Date,
Date,
Thread,
Author