summaryrefslogtreecommitdiff
path: root/shell/key-bindings.bash
diff options
context:
space:
mode:
authorEmilio Vesprini <82109173+emivespa@users.noreply.github.com>2024-03-30 13:13:15 -0300
committerGitHub <noreply@github.com>2024-03-31 01:13:15 +0900
commit7de87a9b2c643ab6a1329666b283cab4ba9cb08e (patch)
tree5fb5b4602482fb600b32428f9abe0c7ee13fcfae /shell/key-bindings.bash
parentdff865239a0cdc79f33e97ec900b2bc8dd6517d2 (diff)
downloadfzf-7de87a9b2c643ab6a1329666b283cab4ba9cb08e.tar.gz
[shell] Make ALT-C use the absolute path to the selected directory (#3688)
Rationale: this way the resulting cd command that ends up in the shell history can be reused to get to the same location regardless of the current working directory. Co-authored-by: LangLangBart <92653266+LangLangBart@users.noreply.github.com>
Diffstat (limited to 'shell/key-bindings.bash')
-rw-r--r--shell/key-bindings.bash2
1 files changed, 1 insertions, 1 deletions
diff --git a/shell/key-bindings.bash b/shell/key-bindings.bash
index a290e4ca..b132b179 100644
--- a/shell/key-bindings.bash
+++ b/shell/key-bindings.bash
@@ -41,7 +41,7 @@ __fzf_cd__() {
opts="--height ${FZF_TMUX_HEIGHT:-40%} --bind=ctrl-z:ignore --reverse --walker=dir,follow,hidden --scheme=path ${FZF_DEFAULT_OPTS-} ${FZF_ALT_C_OPTS-} +m"
dir=$(
FZF_DEFAULT_COMMAND=${FZF_ALT_C_COMMAND:-} FZF_DEFAULT_OPTS="$opts" $(__fzfcmd)
- ) && printf 'builtin cd -- %q' "$dir"
+ ) && printf 'builtin cd -- %q' "$(builtin unset CDPATH && builtin cd -- "$dir" && builtin pwd)"
}
if command -v perl > /dev/null; then