On Mon, 21 Jan 2019 at 20:32, Mikael Magnusson wrote: > With the commit applied, > % print -P %F{10}hello|cat -v > ^[[38;5;8;5;10mhello Following debugs shows that: 1. For color > 7, a termcap-route was being used, ignoring the fg_start_code 2. For color <= 7, the same termap-route was being used ignoring the fg_start_code. 3. The fg_start_code-route is used only for colors <= 7 in some other circumstances (I'm occuring this normally for an region_highlight--&-colors<=7-utilizing code.) http://sprunge.us/GcRDpx (also attached as debug.txt) So basically, Mikachu has following setting: zle_highlight=( fg_start_code:$'\e[38;5;' ) It's always using termcap for color >= 8,, because of this line ~1983 in prompt.c:: if (!def && (colour > 7 || use_termcap)) { But also, the `use_termcap' is apparently always being set if colur > 7. But the new code, NEVER IGNORES fg_start_code if it's different from the default «\e[». So the code starts to finally use the fg_start_code and problems appear. The problems come from the fact that: the are additional fields needed in zle_highlight, to make it fully usable. With the new code it IS usable as it is basically USED after all when set, so e.g. a debugging code (the X04 tests) can use the zle_highlight mechanism reliably. > Blindly appending 8;5; to my custom start code seems extremely > broken and I have no idea under what circumstances it would ever be > correct to do so. In fact it directly contradicts the documentation: > > fg_start_code (\e[3) > The start of the escape sequence for the foreground colour. This > is followed by an ASCII digit representing the colour. > > 8;5; is clearly not an ASCII digit. Ok, but the documentation also misses the fact that in the OLD code, for col > 7 termcap is used anyway, and also the same for col <= 7, if the color is invoked in `print -P %F{5}' and possibly other situations (but not always, region_highlight utilizing the first 8 colors does use fg_start_code also in the old code). -- Sebastian Gniazdowski News: https://twitter.com/ZdharmaI IRC: https://kiwiirc.com/client/chat.freenode.net:+6697/#zplugin Blog: http://zdharma.org