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

Support alias="..." in bun shell #15381

Open
7flash opened this issue Nov 24, 2024 · 1 comment
Open

Support alias="..." in bun shell #15381

7flash opened this issue Nov 24, 2024 · 1 comment
Labels
enhancement New feature or request shell Something to do with Bun as a shell

Comments

@7flash
Copy link

7flash commented Nov 24, 2024

What version of Bun is running?

1.1.34+5e5e7c60f

What platform is your computer?

Linux 6.8.0-31-generic x86_64 x86_64

What steps can reproduce the bug?

add to .zshrc

alias it="echo OK"

ensure it outputs "OK" in CLI directly

then try to run "bun run index.ts"

await Bun.$`it`;

it shows

bun: command not found: it

What is the expected behavior?

No response

What do you see instead?

No response

Additional information

No response

@7flash 7flash added bug Something isn't working needs triage labels Nov 24, 2024
@Electroid Electroid changed the title bun shell does not recognize zsh alias Support alias="..." in bun shell Nov 25, 2024
@Electroid Electroid added enhancement New feature or request shell Something to do with Bun as a shell and removed bug Something isn't working needs triage labels Nov 25, 2024
@pfgithub
Copy link
Contributor

Bun isn't zsh, so it would be strange for it to load the .zshrc file. Also, aliases don't inherit in shells either:

zsh
$> alias hello="echo goodbye"
$> hello
goodbye
$> zsh
  $> hello
  zsh: command not found: hello
  $> exit
$> hello
goodbye

Alias should be suported within a shell script, but I don't think it makes sense to support loading from .zshrc.

$> cat a.sh
alias hello="echo goodbye"
hello
$> sh a.sh
goodbye
$> bun a.sh
bun: command not found: hello

For now, you can use a zsh alias in bun shell with await $`zsh -ic "hello"` (-i is required to load .zshrc)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request shell Something to do with Bun as a shell
Projects
None yet
Development

No branches or pull requests

3 participants