about summary refs log tree commit diff
path: root/Functions/Example/pushd
diff options
context:
space:
mode:
Diffstat (limited to 'Functions/Example/pushd')
-rw-r--r--Functions/Example/pushd4
1 files changed, 4 insertions, 0 deletions
diff --git a/Functions/Example/pushd b/Functions/Example/pushd
index 965c774bf..bb020c0aa 100644
--- a/Functions/Example/pushd
+++ b/Functions/Example/pushd
@@ -2,6 +2,9 @@
 # pushd +/-n just lifts the selected element to the top of the stack
 # instead of just cycling the stack.
 
+local puid
+[[ -o pushdignoredups ]] && puid=1
+
 emulate -R zsh
 setopt localoptions
 
@@ -9,5 +12,6 @@ if [[ ARGC -eq 1 && "$1" == [+-]<-> ]] then
 	setopt pushdignoredups
 	builtin pushd ~$1
 else
+	[[ -n $puid ]] && setopt pushdignoredups
 	builtin pushd "$@"
 fi