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

Re: zle -R does it support color?

On Feb 8,  4:29pm, Wendell Hom wrote:
} I am using zle -R to list the file/directory choices that match a
} string in the buffer. The script serves its purpose, but I can't seem
} to get any color output using zle -R; it displays control characters
} instead. Does zle -R support color output?

No, zle -R doesn't support any sort of terminal control.  ZLE is pretty
restrictive of what it will let you do outside of a prompt string, in
order that it be able to keep track of what the screen (well, the bit
of the screen that it last scribbled on) looks like at all times.
It doesn't "know" which escape sequences require zero display space,
which ones move the cursor around, etc., so it won't emit any of them.

You might be able to do something with POSTDISPLAY and region_highlight
but it'd require a fair amount of work.

} It would be nice to have a color-coded output so I can easily spot
} directories vs. filenames vs symlinks, etc.

Out of curiosity, why are you simulating a completion with zle -R
rather than doing a real completion list and allowing that to color
the results?

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