From 79f5f6671b8ff4a9ac2158b8b8ee3246386d1b09 Mon Sep 17 00:00:00 2001 From: Juhan280 Date: Thu, 12 Feb 2026 19:15:37 +0600 Subject: [PATCH] update minimum nushell version 0.106.0 --- README.md | 2 +- templates/nushell.txt | 26 +++++--------------------- 2 files changed, 6 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index b397f82..1a354b0 100644 --- a/README.md +++ b/README.md @@ -257,7 +257,7 @@ zoxide can be installed in 4 easy steps: > ``` > > **Note** - > zoxide only supports Nushell v0.89.0+. + > zoxide only supports Nushell v0.106.0+. diff --git a/templates/nushell.txt b/templates/nushell.txt index e3b45f4..5a0d330 100644 --- a/templates/nushell.txt +++ b/templates/nushell.txt @@ -4,6 +4,7 @@ # Code generated by zoxide. DO NOT EDIT. module zoxide_integration { + # From version 0.110.0, $nu.home-path has been renamed to $nu.home-dir const homedir = if $nu.home-dir? != null { $nu.home-dir } else { $nu.home-path } {{ section }} @@ -18,15 +19,7 @@ module zoxide_integration { # Initialize hook to add new entries to the database. export-env { {%- if hook == InitHook::Prompt %} - $env.config = ( - $env.config? - | default {} - | upsert hooks { default {} } - | upsert hooks.pre_prompt { default [] } - ) - let __zoxide_hooked = ( - $env.config.hooks.pre_prompt | any { try { get __zoxide_hook } catch { false } } - ) + let __zoxide_hooked = $env.config.hooks.pre_prompt | any { get __zoxide_hook? } if not $__zoxide_hooked { $env.config.hooks.pre_prompt = ($env.config.hooks.pre_prompt | append { __zoxide_hook: true, @@ -34,18 +27,9 @@ module zoxide_integration { }) } {%- else if hook == InitHook::Pwd %} - $env.config = ( - $env.config? - | default {} - | upsert hooks { default {} } - | upsert hooks.env_change { default {} } - | upsert hooks.env_change.PWD { default [] } - ) - let __zoxide_hooked = ( - $env.config.hooks.env_change.PWD | any { try { get __zoxide_hook } catch { false } } - ) + let __zoxide_hooked = $env.config.hooks.env_change.PWD? | default [] | any { get __zoxide_hook? } if not $__zoxide_hooked { - $env.config.hooks.env_change.PWD = ($env.config.hooks.env_change.PWD | append { + $env.config.hooks.env_change.PWD = ($env.config.hooks.env_change.PWD? | append { __zoxide_hook: true, code: {|_, dir| ^zoxide add -- $dir} }) @@ -146,4 +130,4 @@ export use zoxide_integration * # # source ~/.zoxide.nu # -# Note: zoxide only supports Nushell v0.89.0+. +# Note: zoxide only supports Nushell v0.106.0+.