zoxide icon indicating copy to clipboard operation
zoxide copied to clipboard

Nushell breaking change (0.68 module/env-var changes)

Open ehawman opened this issue 3 years ago • 1 comments

Nushell is changing the way modules and env-vars work, which predictably shatters Zoxide's init script.

Currently there's a bug which breaks all source-env imports, so no sense jumping on this at the moment (nushell/nushell#6510), but when complete you'll need to do something like :

export-envs {
    let-env abcd = wxyz
}

export def-env efgh [] {
    let ijkl
}

export alias z = __zoxide_z

and then import all this with use ~/path/to/zoxide.nu *.

zoxide.nu will now be a module, so the * imports all exported functions under it. Alternatively you could embrace this structure and preface all command calls with the module name (i.e. zoxide __zoxide_z"), although I'm really struggling to understand how Nushell is going to differentiate between modules and executables so whatever you do, test the hell out of it 😄.

ehawman avatar Sep 08 '22 19:09 ehawman

Hey, thanks for the heads up! I'll fix it once a new Nushell binary is released.

ajeetdsouza avatar Sep 09 '22 07:09 ajeetdsouza

Tracking this issue here: https://github.com/nushell/nushell/issues/6571

ajeetdsouza avatar Sep 16 '22 15:09 ajeetdsouza

Is this still blocked? Nu 0.69 was on September 28 and we're currently on 0.70.

holly-hacker avatar Oct 20 '22 08:10 holly-hacker

Afaik, the Nushell team still hasn't implemented a full replacement for source, so yes.

ajeetdsouza avatar Oct 20 '22 12:10 ajeetdsouza

Closing this, since the Nushell team doesn't appear to be replacing the source command any time soon.

ajeetdsouza avatar Jan 07 '23 22:01 ajeetdsouza