mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-01-01 05:16:05 +01:00
39795: preserve "cd -" behavior around directory shuffling in _canonical_paths_pwd
This commit is contained in:
parent
59dbab4f1c
commit
0a5aea375d
2 changed files with 6 additions and 1 deletions
|
@ -1,5 +1,8 @@
|
|||
2016-10-31 Barton E. Schaefer <schaefer@zsh.org>
|
||||
|
||||
* 39795: Completion/Unix/Type/_canonical_paths: preserve "cd -"
|
||||
behavior around directory shuffling in _canonical_paths_pwd
|
||||
|
||||
* 39792: Completion/Unix/Type/_canonical_paths: improve handling
|
||||
of relative paths in _canonical_paths_add_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
|
||||
|
|
Loading…
Reference in a new issue