tadzik / rakudobrew

Perl 6 installation manager
MIT License
185 stars 42 forks source link

In zsh and with the new version, it keeps asking about correcting perl6 to perl #141

Closed JJ closed 5 years ago

JJ commented 5 years ago

Apparently, shell functions have a lower priority (or whatever) than commands. Fix:

alias perl6='nocorrect perl6'
patrickbkr commented 5 years ago

Disclamer: My zsh knowledge is very limited. I don't understand this behavior. Rakudobrew does not install any shell function called perl6. Are you sure this is related to rakudobrew? Also I can't reproduce this. Any hints on what I need to do to reproduce are welcome.

JJ commented 5 years ago

I don't understand that either, but it's what happened... I just followed the standard procedure to install.

patrickbkr commented 5 years ago

@JJ I'd be grateful if you could do some investigation yourself. I'm pretty lost here, as I can't reproduce the symptom and am also quite unknowledgable of zsh. For a start I'd check if the strange behavior also appears when you start a shell without the rakudo init code.

avuserow commented 5 years ago

@patzim I'm able to replicate this on my system (Fedora 30). This seems to be caused by the .. within the PATH generated by rakudobrew. If I run rakudobrew init Zsh and copy the resulting output into my zshrc, then I can fix this problem by removing the bin/.. part of the path.

It looks like we just need to do the P5 equivalent of .resolve on the paths we put into $PATH.

Let me know if I can provide any more information on this.

patrickbkr commented 5 years ago

I just pushed a change that strips .. from the paths.

I am still not able to repoduce this on my computer. @avuserow, @JJ can you test this?

avuserow commented 5 years ago

Looks good to me.

I updated my .zshrc to use rakudobrew init Zsh rather than my manual copy/pasted workaround earlier and now it works.

As for why this is only on some machines, maybe this is a recent change in zsh? I've used rakudobrew off and on previously on different linux distros and I'm currently only seeing this on Fedora 30.

Thanks for the fix! :+1:

patrickbkr commented 5 years ago

Sounds good! Closing.

JJ commented 5 years ago

I didn't have time to check, but thanks for taking care of this!