Zsh Mailing List Archive
Messages sorted by:
Re: Suggested improvement for sticky-note
- X-seq: zsh-workers 48811
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Cc: vapnik spaknik <vapniks@xxxxxxxxx>, Zsh Hackers List <zsh-workers@xxxxxxx>
- Subject: Re: Suggested improvement for sticky-note
- Date: Tue, 11 May 2021 12:18:20 +0200
- Archived-at: <https://zsh.org/workers/48811>
- In-reply-to: <CAH+w=7Z0wO_1AgHxhsRLDcActY=YCyp1+1r-w4mJxmKDGhZM9A@mail.gmail.com>
- List-id: <zsh-workers.zsh.org>
- References: <email@example.com> <firstname.lastname@example.org> <CAH+w=7YSJwPwsA1D7xyVi_PoCvpVdB0Ng3OBdF+2UfAd2JeRDw@mail.gmail.com> <email@example.com> <CAH+w=7Z0wO_1AgHxhsRLDcActY=YCyp1+1r-w4mJxmKDGhZM9A@mail.gmail.com>
On 5/9/21, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> 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);
> tsetcap(TCALLATTRSOFF, TSC_PROMPT|TSC_DIRTY);
> 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?
Messages sorted by: