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