Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

wrong LINES, COLUMNS



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