From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from gatech.edu (gatech.edu [130.207.244.244]) by werple.mira.net.au (8.6.12/8.6.9) with SMTP id FAA13685 for ; Sat, 22 Jul 1995 05:06:00 +1000 Received: from math (math.skiles.gatech.edu) by gatech.edu with SMTP id AA19190 (5.65c/Gatech-10.0-IDA for ); Fri, 21 Jul 1995 15:06:49 -0400 Received: by math (5.x/SMI-SVR4) id AA20454; Fri, 21 Jul 1995 15:01:23 -0400 Resent-Date: Fri, 21 Jul 1995 12:02:33 -0700 (PDT) Old-Return-Path: Subject: Multi-line update problem in zholi10.1 To: zsh-workers@math.gatech.edu Date: Fri, 21 Jul 1995 12:02:33 -0700 (PDT) From: Wayne Davison Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-Id: <9507211202.aa02305@tenor.clarinet.com> Resent-Message-Id: <"E4kV73.0.S_4.2c_3m"@math> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/252 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu There's a problem in zholi10.1 where it will not update the screen correctly when inserting characters into the first line of a multi- line command. You have to be using an auto-margin terminal with character insert (in my case I'm using an xterm), to see the problem. The code that is failing is in refreshline() where it checks if there is some space at the end of the line that needs to be cleared. Because it is checking the wrong variable (vcs instead of ccs) it uses right-cursor to try to move to column 80 (one past the right edge) which is not possible -- you can only get to column 80 in a terminal like a vt100 by outputing a character in column 79. This causes the moveto() code to fail to advance to the next line, and then the screen becomes really messed up. I've appended a patch that fixes this problem. It is possible that with this fix the following check for i == 0 isn't needed: /* we've written out the new but yet to clear rubbish due to inserts */ if (!*nl) { if ((i = (winw - ccs < char_ins ? winnw - ccs : char_ins)) == 0) return; but I don't know the code well enough to know for sure. ..wayne.. ---8<------8<------8<------8<---cut here--->8------>8------>8------>8--- Index: zle_refresh.c @@ -490,7 +490,7 @@ for (; *nl && (*nl == *ol); nl++, ol++, ccs++) ; if (!*nl) { - if ((char_ins <= 0) || (vcs >= winw)) /* written everything */ + if ((char_ins <= 0) || (ccs >= winw)) /* written everything */ return; else /* we've got junk on the right yet to clear */ if (tccan(TCCLEAREOL) && (char_ins >= tclen[TCCLEAREOL]) ---8<------8<------8<------8<---cut here--->8------>8------>8------>8---