Every time I use tab autocompletion with zsh instead of completing the current string, it gives me a new string + options to complete. It's hard to explane, so here is an example. This is what would happen if I type 'ls Nue' and hit tab.

[me@mbp:/Volumes/hdd/music]: ls Neu    ls Neu
 Neuraxis/              Neurosis/              Neutral\ Milk\ Hotel/

If I delete the second `ls Nue', I am unable to delete the white space and the first. If I hit return, it is as if I have just entered a blank line. Does anyone know what is going on. A bit of googling suggests that this is a problem with my prompt.

"%{$fg[blue]%}[%n@%m%{$fg_bold[magenta]%}:%d%{$reset_color%}%{$reset_color%}$fg[blue]]$reset_color%}: "
link|improve this question

feedback

2 Answers

up vote 2 down vote accepted

I'm not sure if this would cause your problem, but your prompt may need some %{%} pairs around color sequences or other non-printing elements. If you show what the value of $PS1 is, I can check it.

link|improve this answer
Thanks for your reply. I had a look round and it was suggested that it was most likely my prompt causing the problems. I managed to fix it with a bit of playing about, but I couldn't work out exactly what was causing it. I'll add my original prompt to the question. – Leda Jan 8 '11 at 1:12
@Leda: It might help to see how the color variables and arrays are assigned, however it looks like you have the %{%} in the right places. You do have an extra $reset_color, but I doubt that's the cause of your problem. Try this prompt instead, it should be equivalent, and see if it works properly for you and fixes your problem: '%F{blue}[%n@%m%B%F{magenta}:%d%b%F{blue}]%f: ' (the %{%} are not needed). – Dennis Williamson Jan 8 '11 at 1:39
Missing %{...%} around the $fg[blue] at the end. Modern zsh will let you use %F{...}/%f for colour support without needing to worry about cursor positioning and %{...%} – Phil P Jan 9 '11 at 0:22
@Phil: Good eye. I missed that (the closing one is there, but not the opening one). – Dennis Williamson Jan 9 '11 at 0:32
feedback

You should report this bug to the zsh-users mailing-list, or ask them on their IRC channel.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.