From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5150 invoked by alias); 8 Dec 2014 04:20:27 -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: 33926 Received: (qmail 27072 invoked from network); 8 Dec 2014 04:20:24 -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 X-CMAE-Score: 0 X-CMAE-Analysis: v=2.1 cv=AKpDk7pY c=1 sm=1 tr=0 a=FT8er97JFeGWzr5TCOCO5w==:117 a=kj9zAlcOel0A:10 a=q2GGsy2AAAAA:8 a=oR5dmqMzAAAA:8 a=-9mUelKeXuEA:10 a=A92cGCtB03wA:10 a=yDSvJiP-e9ECi9cqqzUA:9 a=CjuIK1q_8ugA:10 From: Bart Schaefer Message-id: <141207202030.ZM24480@torch.brasslantern.com> Date: Sun, 07 Dec 2014 20:20:30 -0800 In-reply-to: Comments: In reply to Mikael Magnusson "Re: Pre-5.0.5 part 3: Heuristic for ZLE_RPROMPT_INDENT" (Dec 8, 1:46am) References: <140202135837.ZM15483@torch.brasslantern.com> <15702.1391766336@thecus.kiddle.eu> <140207084619.ZM28881@torch.brasslantern.com> <140208115850.ZM30584@torch.brasslantern.com> <140217103448.ZM21515@torch.brasslantern.com> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh workers Subject: Re: Pre-5.0.5 part 3: Heuristic for ZLE_RPROMPT_INDENT MIME-version: 1.0 Content-type: text/plain; charset=us-ascii On Dec 8, 1:46am, Mikael Magnusson wrote: } } I get the glitch when the resulting string is empty, but still prints } something. Eg, } RPS1=%b } RPS1=%f } RPS1=$'\0' } produce the error while } RPS1=' %b' } RPS1='%f ' } don't. I can confirm with xterm and examining the output of typescript that printing a "visible" character (even a space) into column 80 followed by printing a backspace leaves the cursor in column 80; whereas moving the cursor to column 80 and then printing a nul or a control sequence followed by a backspace moves the cursor back to column 79. ZLE is printing the backspace because the auto-margin value reported by the terminfo description says that printing into or beyond column 80 will wrap the line, so ZLE believes it needs to back up onto the original line before continuing. xterm is faking it by ignoring the backspace when it's the first thing that is output after column 80, but if anything else precedes the backspace, xterm loses state and the backspace is processed even though the cursor didn't move. I'm not sure there's any way for ZLE to deal with this without having a lot more knowledge/control over what may appear in the prompt at the rightmost column. It also somehow needs to know whether the terminal actually did wrap, or is just pretending; maybe we have that much already.