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

Aliases set by plugin cannot be executed from other plugins #174

Open
celclow opened this issue Jan 23, 2024 · 2 comments
Open

Aliases set by plugin cannot be executed from other plugins #174

celclow opened this issue Jan 23, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@celclow
Copy link

celclow commented Jan 23, 2024

It seems that aliases set by a plugin cannot be executed by other plugins. Since functions can be executed, I would expect aliases to be similarly executable.

plugins.toml

shell = "zsh"

[plugins]

[plugins.foo]
local = "~/foo"

[plugins.foo.hooks]
post = "aliastest ; functest"

[plugins.bar]
inline = "aliastest ; functest"

~/foo/foo.zsh

alias aliastest="echo aliastest"
functest() {echo "functest"}

Login log
functest can be executed from hooks.post and other plugins, whereas aliastest cannot be executed.

Last login: Tue Jan 23 13:23:34 on ttys001
(eval):2: command not found: aliastest # foo.hooks.post aliastest
functest                               # foo.hooks.post functest
(eval):3: command not found: aliastest # bar.inline aliastest
functest                               # bar.inline functest
% aliastest
aliastest
% functest
functest

zsh version: zsh 5.9 (x86_64-apple-darwin23.0)
sheldon version: sheldon 0.7.4

@rossmacarthur
Copy link
Owner

I'm still investigating why this doesn't work properly, but you can work around it for now by doing the following:

Instead of this

eval "$(sheldon source)"

Use

source <(sheldon source)

@celclow
Copy link
Author

celclow commented Jan 23, 2024

Thanks for the reply.
The workaround you provided worked as expected.
I appreciate your help.

@rossmacarthur rossmacarthur added the bug Something isn't working label Jan 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants