document updated 12 years ago, on Mar 20, 2012
Goal: Rather than changing the color of the prompt, I would prefer to change the color of things I type in. I strongly believe in using the <kbd> tag to visually separate input from output.
What methods exist to do this?
Bash — source code
It might be possible to create a patch for the Bash source code.
- in file:parse.y, function:yy_readline_get:
- just after the call to readline(), add this:
printf("\e[0m");
fflush(stdout);
Bash — using DEBUG trap
see here
ZSH
YES, this is possible in ZSH. ZLE (the line editor) has the capability to load third-party widgets. These widgets can trigger off of specific things, including: