5

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%}: "

2 Answers 2

5

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.

5
  • 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
    Commented Jan 8, 2011 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). Commented Jan 8, 2011 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
    Commented Jan 9, 2011 at 0:22
  • @Phil: Good eye. I missed that (the closing one is there, but not the opening one). Commented Jan 9, 2011 at 0:32
  • Fixed this problem by removing wierd chars in my Oh-My-Zsh theme for vanilla terminal: github.com/robbyrussell/oh-my-zsh/issues/1282 Commented Nov 2, 2012 at 3:55
0

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .