From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 23704 invoked from network); 23 Oct 2020 11:38:41 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 23 Oct 2020 11:38:41 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1603453121; b=LMh++caOInXExQ0T/L/x53ojyxPMONncgIRVO0I87mjn16eiWfAXRJ82UxdDq0aQEXtFqgpcq4 OkxA0eka5t0WB+iAJRBUgEEQciiv2bY2lytWQWaOmFqcONDxh89277t4ViMETTao71Dqz6OJzQ 92APpjEwsX4O5V1NPqLvyMotzdZrakKxvCmgluwpk5lExcRy9pt9Y3/quwAkV8N9Pn684aDW41 D059jlso2Q2nOkoo1xO2YOtNQeQwC+Gp7A532lOKeohw0LozGxxLVcLALk6U167WUj4aFV8+Kg 0xYaO9YlCMUHydZdJBh+jV29DyAO0qxqQM6A3rmRVSIoyg==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-io1-f67.google.com) smtp.remote-ip=209.85.166.67; dkim=pass header.d=gmail.com header.s=20161025 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20200801; t=1603453121; bh=ENtZUviNR4SBq32YplRjNlNGVZD4grE+IelR19rcN0g=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:DKIM-Signature:DKIM-Signature; b=typK/jeHbORzU5U2uFNk3Bf467/NXhgY64Y7mKIBIw86gkeC8PAwEdFYhuX/dMzHTgXVvSJVj7 h7g9KVw8OZFSRH3qjf25XsoHqhrCf3c/bdmPhFtbIcDKEnZ+LoRsJnmpGrwKGe76Z7YK0RCdU+ Jv/ESp4d/FP+TrO9GUEK6fEMDRnRZyW73GEt33EsGMak2D5arMtyw/Z5+q4kna/y0Uvnkw6hj/ b7MXFV8HKXifsmwvPY6mD5wfWCRKboV/r74EgD6zm5zKga6Bgl0BGY7sGzH4wauuxg+vrFxJnp 8h57PKGhyhH0wC5+qG0ELcCANE0lPzyoVVWgCEKnQJDJPA==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20200801; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID :Date:From:In-Reply-To:References:MIME-Version:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=eilnnKMPbScb1r2KX8Z7HBQ90iz6gReDJrttVtYJJo4=; b=Ue2g8BnsJmgGbMhixwvD593SMY 5chpviVxNppPNh2nKgDep+h+KYJ3WtbksAUh3Jbm3ykUtxTPLLWdxMaGVE+l+rPqJ1MMHBoRgaGOq 5xTDsf88APCTGwo6WLGC7WsU5ScyKttnJbskzYmUykKql22iw+7U/FfolSZymPifaVAWJpdzmutkF /i57u0F6gVOnZOpBNaJIUiFo9XLzypFXJqSOkx20rhRcpq0cPXiteFOOOI57hm4t+5bYhxvxirTjR sZackj/AVGKqkSZ8aOFuM27/8HMSC/5A55b7xEw/xvX+US8OjLprrTdU+uMRGLkLwfKKMAn92XQHi +X6jvj7A==; Received: from authenticated user by zero.zsh.org with local id 1kVvP5-0000Py-VY; Fri, 23 Oct 2020 11:38:40 +0000 Authentication-Results: zsh.org; iprev=pass (mail-io1-f67.google.com) smtp.remote-ip=209.85.166.67; dkim=pass header.d=gmail.com header.s=20161025 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-io1-f67.google.com ([209.85.166.67]:33200) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1kVvOq-0000Hu-Kr; Fri, 23 Oct 2020 11:38:25 +0000 Received: by mail-io1-f67.google.com with SMTP id p15so1388324ioh.0 for ; Fri, 23 Oct 2020 04:38:24 -0700 (PDT) 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=eilnnKMPbScb1r2KX8Z7HBQ90iz6gReDJrttVtYJJo4=; b=K0EwqDDq0cTF4Y0QH+CAuoSgLU9vWrf/cVD17SjRjZul9wVTXoCqxdYqxWssTg1VCA Bwgkltnm4H+Kw7jQDkLzEkMbKlQYn4sOExObb0Hh17D/ypbkc3WMQKSOb2EcuFj1O5ou 3BgSU7D8BrNAOkSsxK1RMTtx0fZsdGpRiJOGh//LWjQbe6pll7EvTwB58N2yBfyecKNZ ZLmoKutTL3lvdBfpIxPjlAWu54woF0LS0eqZpKzfyBP8zH9bHMMY6+wEFivA3GfhdEDr rctS8TNhQ6ic8eWFHtwlEfJZp9w99bJJvpemty4SBn+z4fs0VIs6uUmAIu0+PfzLaUYh 4IQg== 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=eilnnKMPbScb1r2KX8Z7HBQ90iz6gReDJrttVtYJJo4=; b=bb4hEP7UW/tsEyqJU2eDXeLLge/qiaOZ15F3l5niOHNGtlfBTetE/v7CBr0UWLLjf2 Id9AnWtUg6LL7CoMdBmimBPLmvE0t++umI/2Q/LMiadhRlxyURXnVWauBSyYmz1UF9PL eQpPSgzVa0wCwvtffmF9Suc/nMai0rmvCqHBeZlTb/Vpj4e3HjQQsnAzvyjojtZY0hMc rlZd11d284wCs/VNS/TUx5zudO3s8g/mXE0th7xvkmN4YJ9Tx+kIkUjR9c0nBA4mkcpP W031j4l+GSx7ocTZsqb2VObmLV6KH2X6y7CR1hUEsRtpwMvVZQQ/lqjHbHZt3Pidw3mJ C5oQ== X-Gm-Message-State: AOAM533WSY0/VvnT69N2UFJq5DUrLAo/FtDy6tei6CtEd/7ULc7bzF0u iINiZkla5jotCclKEnjibkpzffNf6W0yfIxkW0E= X-Google-Smtp-Source: ABdhPJzpb/89XiVrAq4b9tqN2H7CxuCODlTLvNfRH+AdnnXWnt0X7PKPlDgq53J8LNmXZ9/aQRGE3RWqZ42qNkgoafU= X-Received: by 2002:a02:690b:: with SMTP id e11mr1599385jac.33.1603453103193; Fri, 23 Oct 2020 04:38:23 -0700 (PDT) MIME-Version: 1.0 References: <20201014204621.4cf5b2b0@tarpaulin.shahaf.local2> In-Reply-To: From: Roman Perepelitsa Date: Fri, 23 Oct 2020 13:38:11 +0200 Message-ID: Subject: Re: region_highlight converts `fg=default` to `none`, which is not the same To: Marlon Richert Cc: Bart Schaefer , Daniel Shahaf , Zsh hackers list Content-Type: text/plain; charset="UTF-8" X-Seq: 47485 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: Archived-At: On Fri, Oct 23, 2020 at 12:40 PM Marlon Richert wrote: > > On Fri, 23 Oct 2020 at 12:35, Roman Perepelitsa wrote: >> >> The only way to know whether the terminal supports some capability >> (e.g., moving the cursor to the specified location on the screen, or >> highlighting text with 256 colors) and to use the said capability is >> through terminfo. There is no way around it. > > Sure, but that is not necessary for this particular problem. Which problem? As I mentioned, it's definitely possible to add support for italicized text to zsh and to make it consistent with the existing highlighting API. The fact that region_highlight and zle_highlight support "standout" is not a problem but a feature. Standout is a part of the curses standard and zsh interprets it within region_highlight and zle_highlight in a manner consistent with the standard. ("standout" within "colors" is a different matter. That one is incorrect in my opinion.) > If the user wants to pass something to their own terminal, then > just let them. Zsh already lets the user pass in ECMA-48 SGR > parameter values directly in [...] prompt expansions. Do you mean %{...%}? It's indeed useful and allows the user to insert any byte sequence into their prompt. I don't think there is anything specific to ECMA-48 SGR in prompt expansions, or am I missing it? region_highlight doesn't need the equivalent of %{...%} because it's implied. So something like this could work: region_highlight=($'1 2 raw=\e[4m') The value of `raw=` spans until the end of the string, so if you want to combine it with `fg=42`, you'll need to use `fg=42,raw=\e[4m` rather than `raw=\e[4m,fg=42`. That's one way to do it -- I'm not particularly attached to it, just thinking out loud. One tricky part about this is that it doesn't allow you to specify the sequence that undoes the effect of `raw` but this is probably OK because zle inserts SGR0 before every that may have different highlighting. There is something in the code that suggests this isn't always the case but I don't know where this code actually triggers. >From the implementation's point of view this will require quite a bit of work because this doesn't fit the existing framework around zattr. Roman.