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

Re: Feature request: italic style in region_highlight

Bart wrote:
> On Mon, Dec 30, 2019 at 8:27 AM Roman Perepelitsa
> <roman.perepelitsa@xxxxxxxxx> wrote:
> >
> > enter/exit sounds better than my suggestion. Another option: on/off. I
> > haven't thought of it earlier but now I think it pretty good.
> Yes, on/off would be fine.
> > Shall I send a patch? I'd love to have this feature.
> I don't see why not.

That sounds useful, expecially italic.

The lack of free bits in zattr (TXT macros) may be something of an
impediment. It isn't really important to prompts but would matter for
zle. There may be ways to recover bits, for example we have both
TXTBOLDFACE and TXTNOBOLDFACE which allows the code to distinguish the
actions but is redundant in terms of tracking attributes.

> > A related question. Would you (zsh elders) be receptive to my adding
> > percent escapes for italicized (%A and %a) and inverse video (%R and
> > %r) mode? %S and %s would stay unchanged.

%O/%o (for "oblique") would be available. I realise that an oblique font
is not strictly the same as italic.

> Perhaps the way around this is to use %A/%a for "attribute" the way
> %F/%f are use for foreground color.  Thus %A{03} would be italic
> (where supported), %A{07} would be reverse, etc.  Your call whether to
> define some counterpart of the ansi_colours array in prompt.c that
> supplies symbolic names; Functions/Misc/colors has the ECMA-48 table.

I like the idea of %A{...} but would favour symbolic names over numbers
even if we can't guarantee that they are always correct. If people
want full control they can dump literal escapes. The % sequences are
generally friendlier.


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