From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id 0b5555db for ; Sun, 19 May 2019 18:52:33 +0000 (UTC) Received: (qmail 1185 invoked by alias); 19 May 2019 18:52:22 -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: List-Unsubscribe: X-Seq: 44328 Received: (qmail 9123 invoked by uid 1010); 19 May 2019 18:52:22 -0000 X-Qmail-Scanner-Diagnostics: from mail-it1-f194.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.101.2/25454. spamassassin: 3.4.2. Clear:RC:0(209.85.166.194):SA:0(-2.3/5.0):. Processed in 0.770627 secs); 19 May 2019 18:52:22 -0000 X-Envelope-From: roman.perepelitsa@gmail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 209.85.166.194 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=1IMTyU2NM5lcI9eM7UrQH5jYmTrmwiTQHi33VxwAz3M=; b=TWBQEQIgmt7SO6qlIZKybzsu9mLv061xdNuBoMnruFfq0715pP//PG2pK658PIRWh5 Kxk8tSVTJm7z8gOswujG6r5FjQvqKMeMOQLaoICRijWFbDNOSsI7xhUKA1WAcAi5vub/ k45HmWKz4G7dYj6vlUKu95IX2JWJbjRE+Tlxby1oMNPxOBdFwavP4+QS2aw2c7bFZ6Z/ Xjh2RncAjJVpjLfIbY1q44TjEfUZo3buEnthur+YooJWG/B2mGoDO7uJC1JA4JHCZ7XI l4Ns7eCWQFPvz0ga94tWRbmFKPfJUAGBLjPo0uXtoNiGzn3CF2H8oLGZp2DXCxBubJ6K BeJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=1IMTyU2NM5lcI9eM7UrQH5jYmTrmwiTQHi33VxwAz3M=; b=G0jGoolMoGSgysr2yae6nAebin/Gbf/E/p+EEptRG0eVemae6doKOC+YgUoTiyH90l 7DgQA7+k7O9dkg5y1l/yZIR1vTNSm9/70dHGqFFe5/SMrJBSlUdpy41374FU5715TP7o oILSDNVYvYE3dNGSeKA3fVAHfnWctZmFecaxxBRCekXDsKnnBfzm4KgyGdjrChNpmXhw z9sSnUDdvPsD+Nb2EDBAbGSDsIOEmFjwmXjiTwJ8FgJ9Sy2PBLKmSP8zPXDbBnPwCj4O bEDHMdelRltrZ66NQmt3Ka4bu4flqkzor1x/AdczFvTBgRzJ/L0A/zcvRrQ/l1Cb65LK uaGg== X-Gm-Message-State: APjAAAWA2HXLzX9qanX9dzEt4nEDFJ5TAEDQlJLtfT70km5pPTP1nQTs Sahx0PlPxOqvh57TjPOYqtR+Md+z1KRVwDurb2I= X-Google-Smtp-Source: APXvYqyVnMpd2VvCmK1BiV05GCz6qSuxrzQb1++8uOF6LYaalb2IGACkzmCjzhW2q4cJEPhDooO5EzT1c7B2E6yPgxE= X-Received: by 2002:a24:5512:: with SMTP id e18mr26045155itb.112.1558291908706; Sun, 19 May 2019 11:51:48 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Roman Perepelitsa Date: Sun, 19 May 2019 20:51:40 +0200 Message-ID: Subject: Re: Incorrect cursor position when ZLE_RPROMPT_INDENT=0 (with a fix) To: Bart Schaefer Cc: "zsh-workers@zsh.org" Content-Type: multipart/alternative; boundary="000000000000acc96e0589421ba8" --000000000000acc96e0589421ba8 Content-Type: text/plain; charset="UTF-8" I've tested my patch on two more terminals: Dumb Linux terminal (TERM=linux) and Command Prompt with WSL. On both of them ZSH misbehaves without my patch and works correctly with it. Roman. On Sun, May 19, 2019 at 8:09 PM Roman Perepelitsa < roman.perepelitsa@gmail.com> wrote: > On Sun, May 19, 2019 at 7:34 PM Roman Perepelitsa < > roman.perepelitsa@gmail.com> wrote: > >> >> Do I understand you correctly that prior to my patch ZSH >> handled ZLE_RPROMPT_INDENT=0 correctly on terminals that do auto-wrap after >> RPROMPT is written, but my patch broke them? If so, could point me to such >> a terminal? It would be very helpful. I realize that you've had this >> discussion a million times and I appreciate your patience. >> > > Answered my own question. My patch adds an extra space on Mac Terminal. > I've now changed it slightly so that it works correctly on GNOME Terminal > and Mac Terminal. Here's the additional change I've made: > > diff --git a/Src/Zle/zle_refresh.c b/Src/Zle/zle_refresh.c > index 1f293845f..85e55e0d4 100644 > --- a/Src/Zle/zle_refresh.c > +++ b/Src/Zle/zle_refresh.c > @@ -1678,7 +1678,12 @@ zrefresh(void) > > moveto(0, winw - rprompt_off - rpromptw); > zputs(rpromptbuf, shout); > - vcs = winw - rprompt_off; > + if (rprompt_off) { > + vcs = winw - rprompt_off; > + } else { > + zputc(&zr_cr); > + vcs = 0; > + } > /* reset character attributes to that set by the main prompt */ > txtchange = pmpt_attr; > /* > > You can see the whole diff here: > https://github.com/zsh-users/zsh/compare/master...romkatv:rprompt-indent2. > > If anyone can point me to a terminal on which this doesn't work, I'll be > happy to debug and educate myself. > > Roman. > >> --000000000000acc96e0589421ba8--