MercuryTechnologies / nix-your-shell

A `nix` and `nix-shell` wrapper for shells other than `bash`
MIT License
85 stars 12 forks source link

sourcing nix-your-shell causes xonsh to hang #72

Open FlyingWombat opened 3 months ago

FlyingWombat commented 3 months ago
nix-shell -p xonsh
xonsh
nix-your-shell xonsh | source

xonsh will hang, with 100%cpu util.

Setting the aliases manually by copy-pasting them from nix-your-shell xonsh into the xonsh prompt works fine.

xonsh v0.15.1 nix-your-shell v1.4.4

9999years commented 3 months ago

OK, I don't use xonsh though so I won't be able to fix this myself.

FlyingWombat commented 3 months ago

I'm just trying out xonsh, so I don't know how it is supposed to work.

Using execx($(nix-your-shell xonsh | grep -e "aliases")) instead of nix-your-shell xonsh | source works for setting the aliases.

Qyriad commented 3 months ago

This looks probably like a case of xonsh/xonsh#5317, as source is an unthreadable alias.

bestlem commented 1 month ago

@Qyriad Proably not. I think the issue is that for xonsh source only works on files and not pipe I think the correct code is

exec ($(nix-your-shell xonsh))

ie run a subprocess and capture its output the $() and then use Pythons"s exec to execute the code generated,.