Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update nushell init script #966

Merged
merged 9 commits into from
Feb 9, 2025
Merged

update nushell init script #966

merged 9 commits into from
Feb 9, 2025

Conversation

Bahex
Copy link
Contributor

@Bahex Bahex commented Jan 5, 2025

  1. Made __zoxide_z more idiomatic
  2. Updated the hook initialization to avoid breakage on nushell's future 0.102.0 release

To expand on hook initialization:
After nushell/nushell#14704 (comment), starting sub shells would make zoxide's init script throw an error.

With this PR $env.__zoxide_hooked is no longer used. Instead, the list of hooks are checked directly to see if zoxide's hook has already been added.

I checked the new init script on both nushell version 0.89.0 and the latest nushell nightly.
Minimum supported version of nushell doesn't need to change and can be kept at 0.89.0

@ajeetdsouza ajeetdsouza force-pushed the main branch 3 times, most recently from c770a05 to 3fe42e9 Compare January 8, 2025 23:06
@binChris
Copy link

I currently have an issue with the generated nushell script. It seems instead of

if (not ($env | default false __zoxide_hooked | get __zoxide_hooked)) {

it must be

if (not ($env | default false __zoxide_hooked | get __zoxide_hooked | into bool)) {

Note the added | into bool. Without it, the script errors out on this line because for some reason the value is read as string.

Should I make a PR for this or is this PR going to merged?

@KamilKleina
Copy link

Is it ionly my problem that zoxide stopped adding paths to it's db?

@Alan-TheGentleman
Copy link

@KamilKleina not at all, the only way it works is using zoxide add /path but is tedious

@Alan-TheGentleman
Copy link

Alan-TheGentleman commented Feb 7, 2025

@KamilKleina FIXED !!

this is my commit for my personal configs which solve the issue for now until a proper fix !!
Gentleman-Programming/Gentleman.Dots@c00622d

zoxide adds new paths and everything. Enjoy !

@ajeetdsouza
Copy link
Owner

Thanks! Loving the new Nushell syntax :)

@ajeetdsouza ajeetdsouza merged commit da0fdb2 into ajeetdsouza:main Feb 9, 2025
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants