Doing: print -P %F{10}hello | cat -v The debug logs (code at the bottom): Yes, using termcap, color:10 / tccolors:256 / use_termcap:268435456 Yes, using termcap, color:10 / tccolors:256 / use_termcap:268435456 NOT, using termcap, 7 / 256 / 0 Appended [^[[38;5;] to the colseq_buf[^[[38;5;] NOT, using termcap, 0 / 256 / 0 Appended [^[[38;5;] to the colseq_buf[^[[38;5;] Yes, using termcap, 63 / 256 / 268435456 NOT, using termcap, 0 / 256 / 0 Appended [^[[38;5;] to the colseq_buf[^[[38;5;] NOT, using termcap, 7 / 256 / 0 Appended [^[[38;5;] to the colseq_buf[^[[38;5;] NOT, using termcap, 0 / 256 / 0 Appended [^[[38;5;] to the colseq_buf[^[[38;5;] Yes, using termcap, 63 / 256 / 268435456 NOT, using termcap, 0 / 256 / 0 Appended [^[[38;5;] to the colseq_buf[^[[38;5;] Doing: print -P %F{5}hello | cat -v Yes, using termcap, 5 / 256 / 268435456 Yes, using termcap, 5 / 256 / 268435456 NOT, using termcap, 7 / 256 / 0 Appended [^[[38;5;] to the colseq_buf[^[[38;5;] NOT, using termcap, 0 / 256 / 0 Appended [^[[38;5;] to the colseq_buf[^[[38;5;] Yes, using termcap, 63 / 256 / 268435456 NOT, using termcap, 0 / 256 / 0 Appended [^[[38;5;] to the colseq_buf[^[[38;5;] NOT, using termcap, 7 / 256 / 0 Appended [^[[38;5;] to the colseq_buf[^[[38;5;] NOT, using termcap, 0 / 256 / 0 Appended [^[[38;5;] to the colseq_buf[^[[38;5;] Yes, using termcap, 63 / 256 / 268435456 NOT, using termcap, 0 / 256 / 0 Appended [^[[38;5;] to the colseq_buf[^[[38;5;] diff --git a/Src/prompt.c b/Src/prompt.c index 959ed8e3d..1941b8ec9 100644 --- a/Src/prompt.c +++ b/Src/prompt.c @@ -1987,6 +1987,14 @@ set_colour_attribute(int atr, int fg_bg, int flags) */ if (tccan(tc) && (tccolours < 0 || colour < tccolours)) { + + FILE *f = fopen("/tmp/reply", "a+"); + if ( f ) { + fprintf(f, "Yes, using termcap, color:%d / tccolours:%d / use_termcap:%d\n", colour, tccolours, use_termcap); + fflush(f); + fclose(f); + } + if (is_prompt) { if (!bv->dontcount) { @@ -2010,6 +2018,13 @@ set_colour_attribute(int atr, int fg_bg, int flags) */ if (colour > 7) return; + } else { + FILE *f = fopen("/tmp/reply", "a+"); + if ( f ) { + fprintf(f, "NOT, using termcap, %d / %d / %d\n", colour, tccolours, use_termcap); + fflush(f); + fclose(f); + } } if ((do_free = (colseq_buf == NULL))) { @@ -2019,6 +2034,11 @@ set_colour_attribute(int atr, int fg_bg, int flags) strcpy(colseq_buf, fg_bg_sequences[fg_bg].start); + FILE *f = fopen("/tmp/reply", "a+"); + fprintf(f, "Appended [%s] to the colseq_buf[%s]\n", fg_bg_sequences[fg_bg].start, colseq_buf); + fflush(f); + fclose(f); + ptr = colseq_buf + strlen(colseq_buf); if (def) { strcpy(ptr, fg_bg_sequences[fg_bg].def);