Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Termcap and boldface (was sticky-note)



On Tue, May 11, 2021 at 3:18 AM Mikael Magnusson <mikachu@xxxxxxxxx> wrote:
>
> On 5/9/21, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> > 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).

A couple of interesting things.

ANSI clumps together bold/faint/normal as 01/02/22 and
blink/fast-blink/steady as 05/06/25.  21 and 26 are for unrelated
features (double-underline and proportional).  This breaks the pattern
of all the other on/off pairs that are always 0x/2x.

Terminfo man page claims that standout is supposed to be reverse bold,
but zsh's use of termcap in prompts renders %S as reverse only.

> html_chapter/termcap_4.html
> also implies that there is no specific termcap sequence to only turn
> off specific appearance modes.

Terminfo manual says about the vt220 example, "We begin each escape
sequence by turning off any existing modes, since  there is no quick
way to determine whether they are active."  That also doesn't match
what appears to happen in prompts with combinations of %S%B etc.

> 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

That would mean special-casing whether we use symbolic termcap names,
so it's less straightforward that might be expected.




Messages sorted by: Reverse Date, Date, Thread, Author