zsh-users
 help / color / mirror / code / Atom feed
From: koen.van_hoo1@skynet.be
To: zsh-users@sunsite.dk
Subject: wrong LINES, COLUMNS
Date: Fri, 25 Apr 2003 16:54:37 +0200 (MET DST)	[thread overview]
Message-ID: <200304251454.QAA27621@bt0pls.sh.bel.alcatel.be> (raw)

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


             reply	other threads:[~2003-04-25 14:55 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-25 14:54 koen.van_hoo1 [this message]
2003-04-25 15:28 ` Tomi Vainio - Sun Finland
2003-04-26  9:08 koen.van_hoo1
2003-04-26 13:53 ` Tomi Vainio - Sun Finland

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200304251454.QAA27621@bt0pls.sh.bel.alcatel.be \
    --to=koen.van_hoo1@skynet.be \
    --cc=zsh-users@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).