As the post subject’s says, I want to know if there is a way with GNU readline library in C to reproduce the colored background like zsh does when pressing tab key. I want to add this feature for the shell, I am currently working on.
Asked
Active
Viewed 51 times
0
-
1You might want to look into the `readline` library documentation, specifically at [custom completers](https://tiswww.case.edu/php/chet/readline/readline.html#Custom-Completers) functionality. It is not intended for this, but looks like you could hijack it. – Eugene Sh. Feb 02 '23 at 14:59
-
It is _totally_ intended for that, even mentioning filename completion specifically. (You beat me to the comment with the link.) – Dúthomhas Feb 02 '23 at 15:01
-
@Dúthomhas Oh, well, maybe I misunderstood the colored background thing – Eugene Sh. Feb 02 '23 at 15:04
-
@EugeneSh. Lol, I mis-read stuff all the time for dumber reasons than that. (I have no idea how to mess with colors and readline. IDK if it can be done easily.) – Dúthomhas Feb 02 '23 at 15:06
-
@Dúthomhas, I suspect that what Eugene meant is that custom completers are not meant to provide a means to *add coloring* in the context of tab completion. And I would agree. I'm not immediately seeing how that could even be hooked for adding coloring without hacking readline internals. – John Bollinger Feb 02 '23 at 15:10
-
@JohnBollinger Yes... I /s/got/mis-read/ that. – Dúthomhas Feb 02 '23 at 15:11