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

Does not work with nushell version 0.100.0 (Tested macOS & Linux) #955

Closed
archcorsair opened this issue Dec 13, 2024 · 4 comments
Closed

Comments

@archcorsair
Copy link

Summary

Zoxide doesn't work currently on nushell v0.100.0

Nushell version output

╭────────────────────┬───────────────────────────────────────────────────────────────────╮
 version             0.100.0                                                           
 major               0                                                                 
 minor               100                                                               
 patch               0                                                                 
 branch                                                                                
 commit_hash                                                                           
 build_os            macos-aarch64                                                     
 build_target        aarch64-apple-darwin                                              
 rust_version        rustc 1.82.0 (f6e511eec 2024-10-15) (built from a source tarball) 
 cargo_version       cargo 1.82.0 (8f40fc59f 2024-08-21)                               
 build_time          1980-01-01 00:00:00 +00:00                                        
 build_rust_channel  release                                                           
 allocator           mimalloc                                                          
 features            default, sqlite, trash                                            
 installed_plugins                                                                     
╰────────────────────┴───────────────────────────────────────────────────────────────────╯

.config/nushell/config.nu

image

.config/nushell/env.nu

image

Actual

Error on MacOS

Error: nu::shell::external_command

  × External command failed
    ╭─[/Users/nxc/.cache/zoxide/init.nu:16:5]
 15    $env.config = ($env.config | update hooks.env_change.PWD ($env.config.hooks.env_change.PWD | append {|_, dir|
 16      zoxide add -- $dir
    ·     ───┬──
    ·        ╰── Command `zoxide` not found
 17    }))
    ╰────
  help: Did you mean `__zoxide_z`?

Error on Linux

Error: nu::shell::external_command

  × External command failed
    ╭─[/home/archcorsair/.zoxide.nu:34:3]
 33    }
 34    cd $path
    ·   ─┬
    ·    ╰── Command `z` not found
 35  }
    ╰────
  help: `z` is neither a Nushell built-in or a known external command

Expected

Jumping directories with z should not produce errors

@ajeetdsouza
Copy link
Owner

ajeetdsouza commented Dec 13, 2024

zoxide works fine on v0.100.0, this appears to be a config issue.

On macOS, the issue is that the zoxide binary is not in your $PATH - Nushell cannot find any binary named zoxide, and therefore it is not getting initialized.

On Linux, I'm guessing you've pointed z to cd, and that's what's causing the issue? The way to do that is to change your initialization line to zoxide init nushell --cmd=cd | ...etc.

@ajeetdsouza ajeetdsouza added the waiting-for-response Waiting for a response from the issue author. label Dec 13, 2024
@archcorsair
Copy link
Author

archcorsair commented Dec 13, 2024

On macOS, the issue is that the zoxide binary is not in your $PATH - Nushell cannot find any binary named zoxide, and therefore it is not getting initialized.

For macOS, zoxide is installing via nix + home-manager.
This is the config in my zoxide.nix file:

{
  programs.zoxide = {
    enable = true;
    enableZshIntegration = true;
    enableNushellIntegration = true;
  };
}

I'm not having issues with other applications managed by nix/home-manager.
What are some further troubleshooting steps I can take?
PS: I'm on unstable channel

On Linux, I'm guessing you've pointed z to cd, and that's what's causing the issue? The way to do that is to change your initialization line to zoxide init nushell --cmd=cd | ...etc.

You were right about the alias, that corrected the issue. Thanks a lot!

@github-actions github-actions bot removed the waiting-for-response Waiting for a response from the issue author. label Dec 13, 2024
@ajeetdsouza
Copy link
Owner

You must be running a command at some point to add the Nix home directory to your $PATH. Ensure that the zoxide command in your .env.nu file is run after that.

@ajeetdsouza ajeetdsouza added the waiting-for-response Waiting for a response from the issue author. label Dec 16, 2024
@archcorsair
Copy link
Author

Closing. Nushell doesn't bring over most of the PATH entries, after manually adding back everything - worked again like a charm. Thanks for pointing me in the right direction @ajeetdsouza

@github-actions github-actions bot removed the waiting-for-response Waiting for a response from the issue author. label Dec 16, 2024
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

No branches or pull requests

2 participants