nix-community / home-manager

Manage a user environment using Nix [maintainer=@rycee]
https://nix-community.github.io/home-manager/
MIT License
6.68k stars 1.75k forks source link

bug: yazi zsh integration not working #5761

Open brianmay opened 3 weeks ago

brianmay commented 3 weeks ago

Are you following the right branch?

Is there an existing issue for this?

Issue description

With following config:

 programs.yazi = {
    enable = true;
    enableZshIntegration = true;
  };

Open a new shell, start yazi with "ya", change to a new directory, and exit.

The working directory is not changed.

It also produces a message like:

zoxide: no match found

This is because I have zoxide aliased to cd using:

 programs.zoxide = {
    enable = true;
    options = [ "--cmd=cd" ];
  };

And the wrapper script at https://github.com/nix-community/home-manager/blob/release-24.05/modules/programs/yazi.nix#L14 does:

$ cd -- "/home/brian/books"
zoxide: no match found

But the correct command is to use cd builtin and ignore the alias:

$ builtin cd -- "/home/brian/books"

Which works fine.

This is the correct command as documented in the yazi documentation: https://yazi-rs.github.io/docs/quick-start:

builtin cd -- "$cwd"

Unfortunately, the wrapper does not use the "builtin" prefix, so it fails.

Maintainer CC

@xyeno

System information

nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 6.6.44, NixOS, 24.05 (Uakari), 24.05.20240805.883180e`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.18.5`
 - channels(brian): `""`
 - channels(root): `"nixos-23.11"`
 - nixpkgs: `/nix/store/79j6vc975md1w3f2fgli3xw657zyxxyc-source`
sedlund commented 2 weeks ago

this change was merged to master https://github.com/nix-community/home-manager/commit/e8482a798fd85d6316dcf42387ad30b3a079585e

probably merge to release-24.05

sedlund commented 2 weeks ago

tag @XYenon

brianmay commented 2 weeks ago

@sedlund Thanks for the update.

Yes, updating stable would be good, although I have no idea what the policy is for stable updates. I think it might be up to the package maintainer to decide (???).

sedlund commented 2 weeks ago

you can find maintainers by searching and clicking the link here: image

https://github.com/nix-community/home-manager/blob/e1391fb22e18a36f57e6999c7a9f966dc80ac073/modules/programs/yazi.nix#L43

of course you can search this repo as well.

in nixpkgs upstream, ofborg bot will notify maintainers automatically. but as this is home-manager related I tagged above. 🍻