mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-26 21:03:12 +00:00
parent
7926b69d15
commit
9afc4b419e
2 changed files with 8 additions and 0 deletions
|
@ -16,6 +16,8 @@ Note that the shell will attempt to change directory without requiring `cd` if t
|
||||||
|
|
||||||
Fish also ships a wrapper function around the builtin `cd` that understands `cd -` as changing to the previous directory. See also <a href="commands.html#prevd">`prevd`</a>. This wrapper function maintains a history of the 25 most recently visited directories in the `$dirprev` and `$dirnext` global variables. If you make those universal variables your `cd` history is shared among all fish instances.
|
Fish also ships a wrapper function around the builtin `cd` that understands `cd -` as changing to the previous directory. See also <a href="commands.html#prevd">`prevd`</a>. This wrapper function maintains a history of the 25 most recently visited directories in the `$dirprev` and `$dirnext` global variables. If you make those universal variables your `cd` history is shared among all fish instances.
|
||||||
|
|
||||||
|
As a special case, `cd .` is equivalent to `cd $PWD`, which is useful in cases where a mountpoint has been recycled or a directory has been removed and recreated.
|
||||||
|
|
||||||
\subsection cd-example Examples
|
\subsection cd-example Examples
|
||||||
|
|
||||||
\fish
|
\fish
|
||||||
|
|
|
@ -27,6 +27,12 @@ function cd --description "Change directory"
|
||||||
return $status
|
return $status
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# allow explicit "cd ." if the mount-point became stale in the meantime
|
||||||
|
if test "$argv" = "."
|
||||||
|
cd "$PWD"
|
||||||
|
return $status
|
||||||
|
end
|
||||||
|
|
||||||
builtin cd $argv
|
builtin cd $argv
|
||||||
set -l cd_status $status
|
set -l cd_status $status
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue