From ad677d388ceb737b63ffb19e00e617514e3c07dc Mon Sep 17 00:00:00 2001 From: LawAbidingCactus Date: Sun, 26 Apr 2020 09:29:46 +0000 Subject: [PATCH] fix pushd --- CHANGELOG.md | 1 + share/functions/pushd.fish | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) 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