From 58969e22a2be751bb586deca4737c847a69fb105 Mon Sep 17 00:00:00 2001 From: Cole Helbling Date: Fri, 10 Apr 2020 21:39:34 -0700 Subject: [PATCH] Fix `cd`ing home when no matching directory in `fish` (#64) Fix `cd`ing into `$HOME` when no match is found in `fish` shell --- CHANGELOG.md | 4 ++++ src/subcommand/init.rs | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5e23105..f9ad161 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Interactive mode in `zoxide` no longer throws an error if `fzf` exits gracefully. - Canonicalize to regular paths instead of UNC paths on Windows. +### Fixed + +- `fish` no longer `cd`s to the user's home when no match is found. + ## [0.3.1] - 2020-04-03 ### Added diff --git a/src/subcommand/init.rs b/src/subcommand/init.rs index e629bb5..72433d8 100644 --- a/src/subcommand/init.rs +++ b/src/subcommand/init.rs @@ -164,7 +164,7 @@ function {} set -l IFS '' set -l result (zoxide query $argv) - if test -d $result + if test -d $result; and string length -q -- $result _z_cd $result or return $status else if test -n "$result"