Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
preexec problems
- X-seq: zsh-workers 35561
- From: Dave Yost <Dave@xxxxxxxx>
- To: zsh workers <zsh-workers@xxxxxxx>
- Subject: preexec problems
- Date: Sun, 21 Jun 2015 22:53:32 -0700
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:content-type:subject:date:message-id:to:mime-version :sendlaterdate; bh=gJmVcMkq8/V68aJX/dTCBJh1yY0HsRx3+E9isu/ua/E=; b=Q/R1c0SjQ3kMtAcJbwFNUvc0TFYG/L1LYaFVeLhC6ajQUsyYOsqXdYGMCM1Z0oOjXX b54tsmN3rHQniKNC+xBhQJ3JVipM6BHxc0PsEvqMt69Q3dmWmw5B6lzS6D8Ysywzpc7y HuxgxjzHdFHcvQTrCyB3XCCTW/I40dp2q8Mmw6F5UL6PM/3+t9q8Eg/xwSDpjmlkt4zN Y+SnnRqYmzOskiOq41a5Z6nVVqBMwA6nTQpVokcg6RQ3IawJWpOkoq6Z0DHsC7lgZOAX ItPmY3SMUAJagTNw/JV7yEb3xkQ8545ZEpzhNTI3udlkZdvnxmE0AI3eonOyRBqFq431 Wo6w==
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- Sender: Dave Yost <daveyostcom@xxxxxxxxx>
- Sendlaterdate: Sun, 21 Jun 2015 22:53:32 -0700
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