From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13155 invoked by alias); 23 Jun 2016 23:30:57 -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: 38758 Received: (qmail 11638 invoked from network); 23 Jun 2016 23:30:56 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=1zRFnj/7ut3PZkmUIYoPfqn4Zklykiji/16hh5uygsk=; b=PX4ILRodABDEN5Mm5NSHCYql/PTyAoXYt/Yq6P6AGi4Ar/k8lGTMx657Xd8xgLTUS7 9WWBxGtG9x13Z0VXfoO3nJ92lYLqbiJZ6EC9EWUEmC1qUyZUVU8RCWyt/aFfbtgfNLiZ Eg3sK26f+iM/hSso11y4fQ4LktEvZR5PcBz3T5VjsEcDYeI6uOrYcAUdWegffa+I9vL+ JL4iGHxDKNd7Yt6SJ0Sy3DBvcMwWCjVS/6HLiWd2RI7uq5rfmRzsizsoYqXocv5xwhX4 QjgVnneUwOvd1i2CrapNAXmbO1aUp8y1KgX/b8+4wD4SNuEda17/wdp0YI/wrc9do2Ku 4uSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=1zRFnj/7ut3PZkmUIYoPfqn4Zklykiji/16hh5uygsk=; b=SBjcHbKUrHmacOPaWcrjSxYcca+xY8rQsGsPkhD+CGawdQGx0D/BSKdiyxzyVm9qnC WEx5AryIoGClQ0uhwppopuMzeQr401+suPAuKfVRPk6rhNSwEwYofmsDkjdxoZTKMYc3 AYy6l2iQU6AnR+Ez25Qnm3LdmNeH1UCEk+x2qa5Z3JxB0hXo75xgyjQD42yTtqUoo12Z KeewVChAwAi5X90tTm+GWzsnHzcgeLihq/Mxqe09/hb8+sK1dEn2DdHq/ZO+zt96S9Lc rEkOmNzTqGPztYW3XIobKPd/G0cYT8YAQSewRYdoBo+KbJ20HcnoA12mChiKopOyvZ2r KXFg== X-Gm-Message-State: ALyK8tK7Fbf/HXEOkV/ns0hpQhW/biADogDQioe04QM/pkM5tSukh64qVAx6+DGV958i2C3KLiDu6foJqH1zJQ== X-Received: by 10.46.0.22 with SMTP id 22mr318035lja.59.1466724655037; Thu, 23 Jun 2016 16:30:55 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <20160623131959.03fef86b@pwslap01u.europe.root.pri> References: <30660.1466683131@thecus.kiddle.eu> <20160623131959.03fef86b@pwslap01u.europe.root.pri> From: Bart Schaefer Date: Thu, 23 Jun 2016 16:30:54 -0700 Message-ID: Subject: Re: unwanted scrolling of the terminal To: Zsh workers Content-Type: text/plain; charset=UTF-8 On Thu, Jun 23, 2016 at 5:19 AM, Peter Stephenson wrote: > On Thu, 23 Jun 2016 13:58:51 +0200 > Oliver Kiddle wrote: >> >> So why the two spaces? The second of those is what caused the scrolling. > > It appears to be specific to terminals with automatic margins (hasam). Yes, that would be it. > I *think* that code is supposed to have the effect of ensuring if we > subsequently [move] the cursor right without printing then it knows that > the new line is actually a logical continuation of the previous one --- > hence the subsequent carriage return to get back from there. I think it's actually trying to make sure there's room to print the buffer without having the terminal scroll during printing; ZLE has to make sure that the location corresponding to CURSOR=0 won't change while the buffer is being output, and the easiest way to do that is to force any change that might happen to happen first. But I'm surmising from insufficient knowledge, same as you. It's also possible that this is a vi-mode-specific problem though it doesn't sound like it from Oliver's description of code walk-through. The only person who might remember how all this came together is Wayne. > This code is all originally 1990s --- I have no idea if modern terminals > even respond to these tricks. I think automatic margin problems were > much more trendy twenty years ago. Certainly there were more terminals that handled it wrong back then, but it wasn't that long ago that we had to introduce ZLE_RPROMPT_INDENT to address a related issue.