mirror of
https://github.com/junegunn/fzf.git
synced 2025-11-17 15:53:39 -05:00
[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>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user