From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1685 invoked by alias); 17 Dec 2013 17:56:53 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 32144 Received: (qmail 69 invoked from network); 17 Dec 2013 17:56:47 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 From: Bart Schaefer Message-id: <131217095621.ZM8541@torch.brasslantern.com> Date: Tue, 17 Dec 2013 09:56:21 -0800 In-reply-to: <131217091138.ZM8420@torch.brasslantern.com> Comments: In reply to Bart Schaefer "Re: Bug report" (Dec 17, 9:11am) References: <131217091138.ZM8420@torch.brasslantern.com> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: "zsh-workers@zsh.org" Subject: Re: Bug report MIME-version: 1.0 Content-type: text/plain; charset=us-ascii On Dec 17, 9:11am, Bart Schaefer wrote: } } This may in fact be another spot in the prompt code that needs to know } that there is no right-indent. That might actually fix the issue with } scrolling up one line, too, on some terminals. OK, I have tracked this down (and rebuilt my memory) ... Remember what I said about how some terminals scroll when you write to the last character, and other don't, and it's not possible to tell which is which? This applies to the end of any line, not just to the lower right corner. The corner just happens to be the only case where scrolling actually pushes something off the top. Src/Zle/zle_refresh.c:moveto() knows that the last character that was output for the right-prompt was in the rightmost column. What it does not know is whether that left the cursor AT the rightmost column, or whether it wrapped around to the next line. In order to know what to do next, it has to know where the cursor is. So it outputs space-backspace, which is guaranteed to make ANY terminal behave like one of the terminals where the cursor has already wrapped around to the next line. Unfortunately this steps on the first character of whatever was below the prompt. Now it knows where the cursor is, so it can move up one line to place the cursor properly within the line containing the prompt. So to "fix" this (other than by going back to a minimum right-indent of one), we have to re-implement moveto() in some way that allows it to "know" where the cursor is after writing to the rightmost column. There may not be a way to do this without causing a lot of flickery cursor motion.