diff --git a/CHANGELOG.md b/CHANGELOG.md index 06b6960..6831665 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,7 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - Manpages: moved to `man/man1/*.1`. -- Nushell: upgrade minimum supported version to v0.59.0. +- Nushell: upgrade minimum supported version to v0.60.0. ### Fixed diff --git a/README.md b/README.md index b85c283..d171340 100644 --- a/README.md +++ b/README.md @@ -205,7 +205,7 @@ zoxide init nushell --hook prompt | save ~/.zoxide.nu source ~/.zoxide.nu ``` -Note: zoxide only supports Nushell v0.59.0 and above. +Note: zoxide only supports Nushell v0.60.0 and above. diff --git a/man/man1/zoxide-init.1 b/man/man1/zoxide-init.1 index 8b3440c..378b074 100644 --- a/man/man1/zoxide-init.1 +++ b/man/man1/zoxide-init.1 @@ -45,7 +45,7 @@ Nushell): \fBsource ~/.zoxide.nu\fR .fi .sp -Note: zoxide only supports Nushell v0.59.0 and above. +Note: zoxide only supports Nushell v0.60.0 and above. .TP .B powershell Add this to your configuration (find it by running \fBecho $profile\fR in diff --git a/templates/nushell.txt b/templates/nushell.txt index c88a0fe..ed2400f 100644 --- a/templates/nushell.txt +++ b/templates/nushell.txt @@ -14,13 +14,10 @@ # Default prompt for Nushell. let-env __zoxide_oldprompt = (if '__zoxide_oldprompt' in (env).name { $env.__zoxide_oldprompt +} else if 'PROMPT_COMMAND' in (env).name { + $env.PROMPT_COMMAND } else { - if 'PROMPT_COMMAND' in (env).name { - $env.PROMPT_COMMAND - } else { -{# An error causes Nushell to silently print the default prompt. #} - __zoxide_undefined - } + { $env.PWD } }) # Hook to add new entries to the database. @@ -35,7 +32,7 @@ let-env PROMPT_COMMAND = { } {%- when InitHook::Pwd %} -echo $'zoxide: PWD hooks are not supported on Nushell.(char newline)Use `zoxide init nushell --hook prompt` instead.' +echo "zoxide: PWD hooks are not supported on Nushell.\nUse `zoxide init nushell --hook prompt` instead." {%- endmatch %} @@ -51,7 +48,7 @@ def-env __zoxide_z [...rest:string] { let path = if ($rest | length) <= 1 && ($arg0 | path expand | path type) == dir { $arg0 } else { - (zoxide query --exclude $env.PWD -- $rest | str trim -r -c (char newline)) + (zoxide query --exclude $env.PWD -- $rest | str trim -r -c "\n") } cd $path {%- if echo %} @@ -61,7 +58,7 @@ def-env __zoxide_z [...rest:string] { # Jump to a directory using interactive search. def-env __zoxide_zi [...rest:string] { - cd $'(zoxide query -i -- $rest | str trim -r -c (char newline))' + cd $'(zoxide query -i -- $rest | str trim -r -c "\n")' {%- if echo %} echo $env.PWD {%- endif %} @@ -95,4 +92,4 @@ alias {{cmd}}i = __zoxide_zi # zoxide init nushell --hook prompt | save ~/.zoxide.nu # source ~/.zoxide.nu # -# Note: zoxide only supports Nushell v0.59.0 and above. +# Note: zoxide only supports Nushell v0.60.0 and above.