SIGN IN SIGN UP
junegunn / fzf UNCLAIMED

:cherry_blossom: A command-line fuzzy finder

0 0 57 Go

[shell][zsh] Don't resolve symlinks in ALT-c (#4816)

This way ALT-c behaves more aligned with `cd`.

Imagine a setup like:
```
/foo -> foo_real
/foo_real/bar
```

Right now if we first `cd foo` (a symlink to `foo_real`), and
then use ALT-c to goto `bar`, then we would end up executing
`cd /foo_real/bar` instead of `cd /foo/bar`. `$PWD = /foo_real/bar`.

For comparison, if we first `cd foo` and then `cd bar`, we end up with
`$PWD = /foo/bar`.

This commit changes the internal logic of `fzf-cd-widget` to first run
`cd <result of FZF_ALT_C_COMMAND>` in a subshell to simulate the
behavior of `cd`, and then insert the target PWD into the shell history.
This way we get behavior consistent with the builtin `cd` command, while
also recording reusable shell history.
Y
Yi-Yo Chiang committed
7d647c70c286720c225ebb8ab75896e5dbee6af6
Parent: 6bd17f8
Committed by Junegunn Choi <junegunn.c@gmail.com> on 5/31/2026, 3:38:12 AM