From: Matthieu Moy Date: Thu, 12 Jan 2012 14:56:28 GMT Subject: Re: Zsh completion regression Message-ID: In-Reply-To: <1kdr5xk.1sopzul1hygnbrM%lists@haller-berlin.de> lists@haller-berlin.de (Stefan Haller) writes: > I'm using zsh 4.3.11. > > When I type "git log mas", it completes to "git log master\ " (a > backslash, a space, and then the cursor). Same here (although I've been too lazy to bisect myself). The following patch makes the situation better, but is not really a fix: --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@ -525,7 +525,7 @@ __gitcomp () __gitcomp_nl () { local s=$'\n' IFS=' '$'\t'$'\n' - local cur_="$cur" suffix=" " + local cur_="$cur" suffix="" if [ $# -gt 2 ]; then cur_="$3" With this, the trailing space isn't added, but e.g. "git checkout master" does not add the trailing space, at all. The problem is a little bit below: IFS=$s COMPREPLY=($(compgen -P "${2-}" -S "$suffix" -W "$1" -- "$cur_")) The -S "$suffix" adds a space to the completion, but ZSH escapes the space (which sounds sensible in general, but is not at all what we expect). My completion-fu isn't good enough to get any further either unfortunately. -- Matthieu Moy http://www-verimag.imag.fr/~moy/