diff --git a/templates/nushell.txt b/templates/nushell.txt index 90d5cba..5619a14 100644 --- a/templates/nushell.txt +++ b/templates/nushell.txt @@ -45,7 +45,11 @@ def --env --wrapped __zoxide_z [...rest:string] { let path = if (($rest | length) <= 1) and ($arg0 == '-' or $arg0_is_dir) { $arg0 } else { - (zoxide query --exclude $env.PWD -- ...$rest | str trim -r -c "\n") + (try { + zoxide query --exclude $env.PWD -- ...$rest | str trim -r -c "\n" + } catch { + "" + }) } cd $path {%- if echo %}