Hello, zle_highlight array has fields like `fg_start_code' & `fg_end_code'. The first is by default $'\x1b[', the second - 'm'. ANSI colors and True-Colors are using those fields to construct and emit the final, complete escape (by default) code to the terminal. Yet the 248 colors are ignoring zle_highlight and are equipped with terminal code by use of termcap. I think the following line (prompt.c: ~2044) does the conversion: tputs(tgoto(tcstr[tc], colour, colour), 1, putshout); The patch makes the 256 colors to also use zle_highlight. This is the main addition of the patch (also included the TrueColor case, to show that this is done exactly this way): } else if (use_truecolor) { ptr += sprintf(ptr, "8;2;%d;%d;%d", colour >> 16, (colour >> 8) & 0xff, colour & 0xff); + } else if (colour > 7 && colour <= 255) { + ptr += sprintf(ptr, "8;5;%d", colour); Is the patch acceptable? I imagine someone might suspect there exists a terminal that uses escape codes for first 8 colors, but some other kind of codes, collected in termcap, for remaining 248 colors. Can this be considered impossible to accept the patch? BTW. I've made X04 zle tests more rock-solid, because the debug prints I added to track the 256-color/zle_highlight issue were slowing down Zle, and a rare phenomenon (not occurred from the time I've simplified Zle, disabled the echoing of input text) became very often: Ctrl-D was appearing too quickly after Ctrl-A. A sleep of 333 ms made the problem go away, and I think the issue is solved, and Zle tests are quite rock solid now. -- Sebastian Gniazdowski News: https://twitter.com/ZdharmaI IRC: https://kiwiirc.com/client/chat.freenode.net:+6697/#zplugin Blog: http://zdharma.org