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

Re: Turning display attributes on / off in prompt strings



On Wed, Dec 21, 2022 at 9:12 AM Oliver Kiddle <opk@xxxxxxx> wrote:
>
> Are you sure xterm-color is the right $TERM value to use? Are you
> getting that by default or have you set it?

It's what gets set automatically when I ssh from MacOS Terminal.app
(xterm-256color) to Ubuntu.

> % zle-line-init() {
> region_highlight=( 'P 1 2 underline' 'P 1 4 standout' )
> LBUFFER=1234567890
> }
> % zle -N zle-line-init
>
> Only the 2 is in standout.

That's correct.

> So perhaps we do need to invalidate attributes after turning off
> standout and underline if we stick to termcap.

I think the discussion started with the premise that we would only use
termcap if ANSI sequences don't work, and ANSI sequences can turn
on/off specific attributes with the exception of faint/normal/bold ...
so theoretically we could optimize out the tracking/restoration of
most attributes most of the time?

> I'm still sceptical about
> our prompt code doing it for turning bold on.

Agree.




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