help / color / mirror / Atom feed
From: Mikael Magnusson <mikachu@gmail.com>
To: Bart Schaefer <schaefer@brasslantern.com>
Cc: vapnik spaknik <vapniks@yahoo.com>,
	Zsh Hackers List <zsh-workers@zsh.org>
Subject: Re: Suggested improvement for sticky-note
Date: Tue, 11 May 2021 12:18:20 +0200
Message-ID: <CAHYJk3TJK7xZNx1nKE2A4xTvLy+oXjVFniVtWW_UtkN-UMAyuA@mail.gmail.com> (raw)
In-Reply-To: <CAH+w=7Z0wO_1AgHxhsRLDcActY=YCyp1+1r-w4mJxmKDGhZM9A@mail.gmail.com>

On 5/9/21, Bart Schaefer <schaefer@brasslantern.com> wrote:
> Just now getting back to this ...
> Finally, you've embedded the definition-time theme color in the note
> at the point where blink is turned off, so if the theme changes (new
> zstyle applied) any notes that had color changes or blink will revert
> to the previous theme's coloring.  In fact this makes me aware that it
> doesn't really work to interpret prompt escapes, because (for example)
> after %Bbold%b the background color reverts as well and the rest of
> the note is no longer yellow.
> It's going to take a bit more thought to decide what it's possible to
> salvage from this, so no patch yet.
> For any other zsh-workers reading this:  Does anyone know why
> putpromptchar() has this?
>             case 'b':
>                 txtchangeset(txtchangep, TXTNOBOLDFACE, TXTBOLDFACE);
>                 txtunset(TXTBOLDFACE);
>                 tsetcap(TCALLATTRSOFF, TSC_PROMPT|TSC_DIRTY);
>                 break;
> That is, why TCALLATTRSOFF ?  That isn't done for %s or %u ... why is
> there no TCBOLDFACEEND defined?

I think that's a shortcoming in termcap and/or terminfo. In termcap
there is md (1m) and me (0m) that should correspond to bold, but 0m
turns off all attributes. Compare with us (4m) and ue (24m).
also implies that there is no specific termcap sequence to only turn
off specific appearance modes.

When it comes to ANSI sequences though, there definitely are. From ctlseqs.txt,

            Ps = 2 2  -> Normal (neither bold nor faint)
            Ps = 2 4  -> Not underlined
            Ps = 2 5  -> Steady (not blinking)
            Ps = 2 7  -> Positive (not inverse)
            Ps = 2 8  -> Visible, i.e., not hidden (VT300)

Since we already assume ANSI for things like colors, I don't think we
would lose a lot of compatibility in practice if we just use 22
instead of 0 for %b, but we could potentially put it behind a setopt?

Mikael Magnusson

  reply	other threads:[~2021-05-11 10:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1185563186.165566.1619896723304.ref@mail.yahoo.com>
2021-05-01 19:18 ` vapnik spaknik
2021-05-02 23:57   ` Bart Schaefer
2021-05-04  2:06     ` vapnik spaknik
2021-05-09 20:50       ` Bart Schaefer
2021-05-11 10:18         ` Mikael Magnusson [this message]
2021-05-14 23:40           ` Termcap and boldface (was sticky-note) Bart Schaefer
2021-05-11 12:37         ` Suggested improvement for sticky-note vapnik spaknik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAHYJk3TJK7xZNx1nKE2A4xTvLy+oXjVFniVtWW_UtkN-UMAyuA@mail.gmail.com \
    --to=mikachu@gmail.com \
    --cc=schaefer@brasslantern.com \
    --cc=vapniks@yahoo.com \
    --cc=zsh-workers@zsh.org \


* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link


This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://inbox.vuxu.org/zsh-workers

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 zsh-workers zsh-workers/ http://inbox.vuxu.org/zsh-workers \
	public-inbox-index zsh-workers

Example config snippet for mirrors.
Newsgroup available over NNTP:

code repositories for the project(s) associated with this inbox:


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git