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

Space after completion disappears



When a file is tab completed, and you didn't have to select from a menu, a space is added immediately after the file. However, typing another character that denotes the end of that command--ampersand, semi-colon, vertical pipe--causes the space to be erased. I would expect the semi-colon to have this behavior, but not the ampersand or the pipe. Consider these keystrokes in a directory with a single file 'foobar':

% touch foo<TAB>;
After the tab, the line reads "touch foobar " (note the trailing space). Typing ";" after it removes the space, and you get "touch foobar;", which is desired. However...

% rm foo<TAB>&
I want to background the rm command. After hitting tab, I see "rm foobar " (trailing space again). Pressing "&" deletes the space, and you see "rm foobar&". It would be better if it left the space, showing "rm foobar &". Both "rm foobar&" and "rm foobar &" do exactly the same thing, but the second one is preferred. The pipe is the same:

% cat foo<TAB>| sed ....
Ignore the useless use of cat. After typing the pipe, you get "cat foobar| sed ...." and not "cat foobar | sed ....". The second is preferable because it is neater.

I tried to squash the bug myself, but got hopelessly confused looking through ZLE code. I'm reporting it in the hope that someone else will fix it.

Michael Hwang



      



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