zsh-workers
 help / color / mirror / code / Atom feed
From: Alexey Bezhan <al@fueledbylemons.com>
To: zsh-workers@zsh.org
Subject: PATCH _cd: completion fails for "cd .." if $PWD/.. contains a space
Date: Fri, 27 Dec 2013 21:15:54 +0000	[thread overview]
Message-ID: <8C206EB3503E4B9FAF437799DFF051CD@fueledbylemons.com> (raw)
In-Reply-To: <8DAABB32CF84427596279B599BB929DB@fueledbylemons.com>

Hi,

There’s a bug in _cd completion that results in empty result when trying to
complete after “cd ../” if there’s a space somewhere in $PWD/..

Steps to reproduce:
$ mkdir -p "a b/c”
$ cd "a b/c”
$ cd ../<TAB> # Results in `local directory’ and no completion suggestions.

The following patch fixes the space issue, but there may be other cases that
cause the same behavior that aren’t fixed by this change.

diff --git i/Completion/Zsh/Command/_cd w/Completion/Zsh/Command/_cd
index a5d328f..abd4fa0 100644
--- i/Completion/Zsh/Command/_cd
+++ w/Completion/Zsh/Command/_cd
@@ -57,7 +57,7 @@ else
# Use cd in a subshell to properly [not] resolve symlinks
tmpprefix=$(cd ${PREFIX%/*} >&/dev/null && print $PWD)
if [[ -n $tmpprefix ]]; then
- tmpWpath=(-W $tmpprefix)
+ tmpWpath=(-W \"$tmpprefix\")
IPREFIX=${IPREFIX}${PREFIX%/*}/
PREFIX=${PREFIX##*/}
fi

--
Alexey Bezhan


  reply	other threads:[~2013-12-27 21:16 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-11 19:14 Compatibility issue in the _django completion Alexey Bezhan
2013-12-27 21:15 ` Alexey Bezhan [this message]
2013-12-28  8:00   ` PATCH _cd: completion fails for "cd .." if $PWD/.. contains a space Bart Schaefer
2013-12-30  9:23     ` PATCH _cd: completion fails for Carlo
2013-12-30 16:13       ` Carlo
2013-12-30 16:15       ` Carlo
2013-12-30 19:29         ` Bart Schaefer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8C206EB3503E4B9FAF437799DFF051CD@fueledbylemons.com \
    --to=al@fueledbylemons.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).