Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [PATCH] Re: zsh completion for umount
- X-seq: zsh-workers 39795
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: [PATCH] Re: zsh completion for umount
- Date: Mon, 31 Oct 2016 12:32:52 -0700
- Cc: Fourhundred Thecat <400thecat@xxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject:cc :mime-version; bh=b95M+8l7PetcM7fhT7sC5pqQf6uwi1471ZFi8x/jQXI=; b=x64eSS/h61IYUQPzkCFRa2XavJplWuaPVYxysfgw4zXSHNPhzSt9EY7c9/4ajcXNBU DSnug8Li6YyudTLZwCsS7FDTwzyjOS23XaTpYjoaMPT0PaA0bGqz5ZR4bUl16SF2v9UA S+WwO9E0HVF1QzJfHGKhwCsxYD08OzCBI+dc4hTZe6kfJqbAV3GeLr+9i5R+aHJr5xNC jemCtJtl/89N2P7fjUQcL3XIdQHtpe2liXoMHvkI32ezT//7widG+F69fwQX9pvhcIYZ Qjt4VAfSJdNIUl3k5UroWCQ/tGoA8Anfpg8wftOfA62MS9aBNGk30kEPmOqEMaZrKt/w p82A==
- In-reply-to: <161031080627.ZM20240@torch.brasslantern.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <5815DDAB.8070307__40712.3355348178$1477828401$gmane$org@gmx.ch> <20161030153537.GB12137@fujitsu.shahaf.local2> <58164C21.9090505@gmx.ch> <161031004732.ZM18486@torch.brasslantern.com> <161031080627.ZM20240@torch.brasslantern.com>
On Oct 31, 8:06am, Bart Schaefer wrote:
}
} The remaining problem is that _canonical_paths_pwd screws up "cd -"
Patch below attempts to fix that.
This whole file relies on native zsh mode, but never declares that anywhere
I guess that's OK as long as always called from completion.
diff --git a/Completion/Unix/Type/_canonical_paths b/Completion/Unix/Type/_canonical_paths
index 6482602..4b6b0c0 100644
--- a/Completion/Unix/Type/_canonical_paths
+++ b/Completion/Unix/Type/_canonical_paths
@@ -16,11 +16,13 @@
_canonical_paths_pwd() {
# Get the canonical directory name by changing to it.
integer chaselinks
+ local oldpwd=$OLDPWD
[[ -o chaselinks ]] && (( chaselinks = 1 ))
- setopt localoptions nopushdignoredups chaselinks
+ setopt localoptions nopushdignoredups chaselinks noautopushd
if builtin pushd -q -- $1 2>/dev/null; then
REPLY=$PWD
(( chaselinks )) || unsetopt chaselinks
+ [[ -n $oldpwd && -d $oldpwd ]] && builtin cd -q $oldpwd # For "cd -"
builtin popd -q
else
REPLY=$1
Messages sorted by:
Reverse Date,
Date,
Thread,
Author