From a63723e7a714d1e135a7c7bf9d14877ae18d8777 Mon Sep 17 00:00:00 2001 From: Cole Helbling Date: Fri, 10 Apr 2020 21:34:43 -0700 Subject: [PATCH] fixup! fixup! fixup! Fix `cd`ing home when no matching directory in `fish` --- src/subcommand/init.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/subcommand/init.rs b/src/subcommand/init.rs index 4f5fa53..72433d8 100644 --- a/src/subcommand/init.rs +++ b/src/subcommand/init.rs @@ -160,11 +160,15 @@ function {} or return $status else + # FIXME: use string-collect from fish 3.1.0 once it has wider adoption + set -l IFS '' set -l result (zoxide query $argv) - if begin; test -d $result; and string length -q -- $result; end + if test -d $result; and string length -q -- $result _z_cd $result or return $status + else if test -n "$result" + echo $result end end end