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 e1ffb875 for ; Sun, 19 May 2019 18:10:18 +0000 (UTC) Received: (qmail 10255 invoked by alias); 19 May 2019 18:10:06 -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: 44324 Received: (qmail 16674 invoked by uid 1010); 19 May 2019 18:10:06 -0000 X-Qmail-Scanner-Diagnostics: from mail-it1-f171.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.171):SA:0(-2.0/5.0):. Processed in 3.301185 secs); 19 May 2019 18:10:06 -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.171 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=VDq3K932INBHKtycTylmjgK0Uqna0HN80+hLP5r7OOY=; b=UUbgm2XGGxKmC/PsgbsLN/gb46vGwQitbrg45iWt56uYp87514NYsPwsgTUX8iJzO5 tCJcRRdrLyuulnrMQkQklXnjhexWSiiq5Pi4ChtJy0P3MVZt6ZVsjZcgEtklj6p8tnTf 6MVSno2e10PRMJRAV8M3cWrKK54eaFg8VnPnIWUnjQxFF+gxJqzu4ZehcRqvo+u6q1h0 a0CJhzVvAYLsRouDX/sX3McHGLzcQy6kAWRIBseBUzvf+iSSSQSLgXoN4+nk0jS2012r pS+2BUvedxzVCwl+RmSB/m3eAVVistY6OR1EBaQDOasuRY2llB9hpES3Dn7/zsGC8g23 cD5w== 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=VDq3K932INBHKtycTylmjgK0Uqna0HN80+hLP5r7OOY=; b=JmBhJfvJngiYktbROp9scXUE87APVAvaa1LSMQlMkHmkrhgGzl+R7lIcyaSvcggmTD 1ZboKbBn47c2npishnZS0HAF8Z2pe8w2vu7vQIH5a4nkVnTdG0j8pI82wixpZFMEBnTv bBKt2IRvY7oUi/pDvsm+d9zsr3bRA+pxomQqib0iAptNEyMJk/sKVESH4s7ucA/UP5uz Ykxz0rI5/MNhKVkkqo9UHSKjBxGKn/UA6J4WIPRP42IQ0Xmd+gkFepNcMkvtCDxaMpB5 pR761e3U5VWgA7FQCsSHtlh/bP2zIfwfj9mGm7REyimnnvuhQnf+c0MKrxf1HH7BTNhx gk/Q== X-Gm-Message-State: APjAAAVI/IZyeG/2SoXSXERbqN4LW1IDADgbg/QmTCECt2ahwM+2FYjU stlYbYHwNmwBbB3VyMvQHHALSt5BeHJeP2Dohl2BCsqj X-Google-Smtp-Source: APXvYqy3goJjdQzGMjnIOuChOfJhbuXeVEa33iaV7Fov6Y/MuU7KL6HZBp7b/9/tnPXtzrW4hHc18QK7Iof4mcRNZbs= X-Received: by 2002:a24:5512:: with SMTP id e18mr25953785itb.112.1558289370734; Sun, 19 May 2019 11:09:30 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Roman Perepelitsa Date: Sun, 19 May 2019 20:09:19 +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="000000000000666c66058941840f" --000000000000666c66058941840f Content-Type: text/plain; charset="UTF-8" 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. > --000000000000666c66058941840f--