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

Allow to disable install completions altogether #11179

Open
martin-braun opened this issue May 19, 2024 · 6 comments
Open

Allow to disable install completions altogether #11179

martin-braun opened this issue May 19, 2024 · 6 comments
Labels
enhancement New feature or request

Comments

@martin-braun
Copy link

martin-braun commented May 19, 2024

What is the problem this feature would solve?

Checking on the installer script, I see no way to skip the install completions, other than installing through an unsupported shell. I carefully craft and maintain my dot files, I wish to do the completions by hand. Also #10897 gives me a bitter aftertaste.

What is the feature you are proposing to solve the problem?

A way to opt-out of install completions altogether, on installation or any update. For this I would propose that we can set export BUN_SKIP_INSTALL_COMPLETIONS=1 in our dot files. I don't wish bun to tinker with my configuration.

What alternatives have you considered?

I removed the necessary parts from the installer script prior install, but seeing that an update might cause the completions to run anyways makes me ask for a better solution.

Bun is for programmers. You can be a toy for Windows users, but not for Unix users, please. I would even support to get rid of install completions altogether at this point.

@martin-braun martin-braun added the enhancement New feature or request label May 19, 2024
@YogiLiu
Copy link

YogiLiu commented Jun 6, 2024

I think bun can remind users to write commands into the corresponding configuration files instead of rudely making decisions for users, not just only completions, but also PATH.

@YogiLiu
Copy link

YogiLiu commented Jun 6, 2024

Many Unix users have a dedicated directory structure to manage shell configurations, and currently such behavior can really cause trouble.

@sirenkovladd
Copy link
Contributor

Like workaround, you can add text "# bun completions" in your .zshrc or .bashrc for avoid auto install completions

https://github.com/oven-sh/bun/blob/bun-v1.1.12/src/cli/install_completions_command.zig#L540

@YogiLiu
Copy link

YogiLiu commented Jun 6, 2024

@sirenkovladd I think this is just a temporary solution. At least for users of oh-my-zsh, the solution using environment variables will be better than it.

@martin-braun
Copy link
Author

martin-braun commented Jun 6, 2024

@sirenkovladd That probably works, but you see where this is going? Magic, magic, everywhere. No, we should not admire complexity and instead we should strive for simplicity. A tool can instruct me on editing my configuration to make itself work, but it should not try to cover everyone and any dependency upstream.

Dependency upstream, because of the dependency chain, which is just in the wrong order at this point. First there was the shell configuration, then comes the tool that gets installed into the system. This is a many to one, there are many different shell configurations, but there is only one bun. bun has to stay in its limits, because it's not its job to tinker with dependencies it knows nothing about. It really tries to guess and cover anything by brute force, the very opposite of simplicity.

I might have a file with completions and my comments don't include completions, because the file's name implies that. I will not disrupt a configuration for something that relies on my configuration. Imagine every tool you install would do this, your rc files would be full with "do not edit this comment" comments all galore.

But to be clear: I know that you aren't justifying it, you just offering a work around, so thank you for that. We shouldn't accept this as (part of) a solution, though.

@sirenkovladd
Copy link
Contributor

I agree with you, it's not a solution, like I said, it's just a workaround

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

No branches or pull requests

3 participants