From 458e8d1812153b7ea8f78d7987f99b02a5ac05fc Mon Sep 17 00:00:00 2001 From: Dmytro Meleshko Date: Mon, 28 Oct 2019 12:42:54 +0200 Subject: Added comparison with $PWD back --- examples/bash_automatic_cd.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'examples') 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" -- cgit 1.4.1-2-gfad0