From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.5 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=3.4.4 Received: from zero.zsh.org (zero.zsh.org [IPv6:2a02:898:31:0:48:4558:7a:7368]) by inbox.vuxu.org (Postfix) with ESMTP id 709032210B for ; Sat, 30 Mar 2024 02:07:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Message-ID:Date:Content-ID: Content-Type:MIME-Version:Subject:To:References:From:In-reply-to:cc:Reply-To: Content-Transfer-Encoding:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=kVigQW1f9iA7TkKTjeJk4dLeyF+XuiOYPXtZ/H6V/6c=; b=EGySm0E0Iov2v/Eub1tzLlnzie CBxI8h79IuCiw2kxe0FtqPe8NQnT14GMUzLOS1m76WBNmrcTIduIBIJl/qegsaKYn5IDVOhko9VQx mnKOTnag0q6iehV5cPlY8bmIQEso34gk3CgDMEnSwxOe7NIaA5Otmn/Z/QF83XBNsBxkIbd9+v+Cx VsgOJmX3mAHvAjTf8MLrsgOmzt95JPkGnuKhrpylJcjQhPtSP9NEPlmVRC3rgUbfnZSHmGt97IhIl QBeLM6hs97n2t9vF+WI4hCf9U24TJ5HZgi0KUoZVVK5E8/yNrjz+Flyf0JM8wNXo7+ySCjVNb+nfT KEnRmGVg==; Received: by zero.zsh.org with local id 1rqNBn-0007Wd-4O; Sat, 30 Mar 2024 01:07:19 +0000 Received: by zero.zsh.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1rqNBC-0007E5-7m; Sat, 30 Mar 2024 01:06:42 +0000 Received: from [192.168.178.21] (helo=hydra) by mail.kiddle.eu with esmtp(Exim 4.97.1) (envelope-from ) id 1rqNBB-00000000GxR-25Bq; Sat, 30 Mar 2024 02:06:41 +0100 cc: Zsh workers In-reply-to: From: Oliver Kiddle References: <90949-1709342493.093890@W3fn.AXo8.ESGa> To: Bart Schaefer Subject: sticky-note and prompt color leftovers (Re: PATCH: broader support for highlight groups) MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <65187.1711760801.1@hydra> Date: Sat, 30 Mar 2024 02:06:41 +0100 Message-ID: <65188-1711760801.491883@dElB.g8CB.0-rg> X-Seq: 52857 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: , List-Subscribe: , List-Unsubscribe: , List-Post: List-Owner: List-Archive: On 1 Mar, Bart Schaefer wrote: > If you choose to disable bleed-over, please have a look at the way > Functions/Misc/sticky-note applies its background coloring and adjust > if necessary? I've never really spent any time understanding > zle_highlight, and although "vared" has options to set the prompts any > highlighting would (I think?) have to be done in the line-init and > line-finish widgets if the prompts can't bleed? Firstly, on the subject of sticky-note, had you intended to commit 47563 and/or 48773? sticky-note uses raw escape sequences so it remains as broken as before. For someone who does use zle_highlight, they get an initial clear to end-of-line with the yellow background and then what they configured applies for entered text. If that doesn't include a background the yellow sticks around, at least until backspace, Ctrl-L or something similar is pressed. It doesn't need much more than to precede the vared with, e.g. local zle_highlight=( default:fg=black,bg=yellow ) Passing -p "%F{black}%K{yellow}" also works but I noticed one key difference to the old bleed-over of raw escapes which is that they aren't used for the initial clear to end-of-line sequence. I've attached a patch which rectifies this but I won't be applying this as-is. Backspace leaves default colours behind it - zsh is printing spaces over erased characters. And this change also applies to clear to end-of-display which I find a bit much. I know that when I worked on this a year ago, I had it in mind to add an additional key for zle_highlight which is used for line clearing allowing a background for the area on the right that doesn't contain text. I can't remember whether or not it was discussed. Any thoughts on the name - viewport, buffer, field? Limiting it to lines that contain text where we currently clear to end of display might be tricky. Though that might please the person who complained about that overwriting text they were randomly printing below the cursor. Oliver diff --git a/Src/Zle/zle_refresh.c b/Src/Zle/zle_refresh.c index f076bdd61..3f48e30dd 100644 --- a/Src/Zle/zle_refresh.c +++ b/Src/Zle/zle_refresh.c @@ -600,7 +600,8 @@ unset_region_highlight(Param pm, int exp) static void tcoutclear(int cap) { - cleartextattributes(0); + treplaceattrs(prompt_attr); + applytextattributes(0); tcout(cap); }