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

preexec problems



It occurred to me that using the preexec hook, I could get the command line to be in another color.

However, there are some bugs. The white command line characters below come about from using tab completion.

0 Sun 22:48:55 yost DaveBook ~
203 Z% cd /tmp
0 Sun 22:49:02 yost DaveBook /tmp
204 Z% mkdir -p  a/b/c/d
0 Sun 22:49:10 yost DaveBook /tmp
205 Z% ls a/b/c/d 
0 Sun 22:49:17 yost DaveBook /tmp
206 Z% 

0 Sun 22:50:55 yost DaveBook /tmp/a
210 Z% mkdir 1 2 3 4 5 6
0 Sun 22:51:06 yost DaveBook /tmp/a
211 Z% ls         ls
1/  2/  3/  4/  5/  6/  b/

This last problem was from typing “ls” and then tab. And it gets worse if you try to backspace.

Here is an easy way to reproduce this:

Z% PS1="$PS1%B"                         
Z% function preexec { echo -n '\e[39m' }
Z% echo yea
yea
Z% ls a/b/c/d 
Z% ls a/b/c 
d
Z%         




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