diff --git a/CHANGELOG.md b/CHANGELOG.md index 50dd7851e..89ef40f27 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ - On BSD systems, with the `-s` option, `fish_md5` does not use the given string, but `-s`. From now on the string is used. - Control-C no longer kills background jobs for which job control is disabled, matching POSIX semantics (#6828). - Improve Gradle completion +- Fixed `pushd`'s behavior with respect to the directory stack when given an invalid argument ### Syntax changes and new commands diff --git a/share/functions/pushd.fish b/share/functions/pushd.fish index 47c16db22..90a04ef8d 100644 --- a/share/functions/pushd.fish +++ b/share/functions/pushd.fish @@ -76,6 +76,6 @@ function pushd --description 'Push directory to stack' end # argv[1] is a directory - set -g -p dirstack $PWD - cd $argv[1] + set -l old_pwd $PWD + cd $argv[1]; and set -g -p dirstack $old_pwd end