about summary refs log tree commit diff stats
path: root/examples
diff options
context:
space:
mode:
authorDmytro Meleshko <dmytro.meleshko@gmail.com>2019-10-28 12:42:54 +0200
committerDmytro Meleshko <dmytro.meleshko@gmail.com>2019-10-28 12:42:54 +0200
commit458e8d1812153b7ea8f78d7987f99b02a5ac05fc (patch)
tree58f09fdd3a6e174fbe242bc126c0b58e5c15a9e4 /examples
parentc86a80ca75fd54ada54f0abc4cd71e7fda87d7a3 (diff)
downloadranger-458e8d1812153b7ea8f78d7987f99b02a5ac05fc.tar.gz
Added comparison with $PWD back
Diffstat (limited to 'examples')
-rw-r--r--examples/bash_automatic_cd.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/examples/bash_automatic_cd.sh b/examples/bash_automatic_cd.sh
index 8bf58a9f..0f09079d 100644
--- a/examples/bash_automatic_cd.sh
+++ b/examples/bash_automatic_cd.sh
@@ -11,7 +11,7 @@ ranger-cd() {
     local temp_file chosen_dir
     temp_file="$(mktemp -t "${0}.XXXXXXXXXX")"
     ranger --choosedir="$temp_file" -- "${@:-$PWD}"
-    if chosen_dir="$(<"$temp_file")" && [ -n "$chosen_dir" ]; then
+    if chosen_dir="$(<"$temp_file")" && [ -n "$chosen_dir" ] && [ "$chosen_dir" != "$PWD" ]; then
         cd -- "$chosen_dir"
     fi
     rm -f -- "$temp_file"