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

Re: [regression] %2K prompt expansion no longer works



2020-10-25 22:29:44 +0100, Mikael Magnusson:
[...]
> >> Just noticed that these [unposted] testcases don't pass. Added some
> >> debugging prints and it turns out that %F{green} uses a different code
> >> than specifying the number. Eg,
> >>
> >>     echo $F1 $F2 $F3 $F4 | cat -v
> >>
> >> results in
> >>
> >> ^[[38;5;2m ^[[38;5;2m ^[[38;5;2m ^[[32m
[...]

I can reproduce with:

$ TERM=rxvt-unicode-256color zsh -c 'print -P %F{green}' | hd
00000000  1b 5b 33 32 6d 0a                                 |.[32m.|
00000006
$ TERM=rxvt-unicode-256color zsh -c 'print -P %F{1}' | hd
00000000  1b 5b 33 38 3b 35 3b 31  6d 0a                    |.[38;5;1m.|
0000000a

Shouldn't %F{green} give the same as %F{2} (echoti setaf 2) instead of
hardcoding the escape sequence?

-- 
Stephane




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