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
do not edit user configuration files without notifying user/confirmation #2722
Comments
@atomi Thanks for filing this issue. Will change the behavior to ask for confirmation before adding it. |
This is super annoying - each |
oh I see.. because mc is in different location each time you run functional-tests.sh @kannappanr did we get any confirmation that we should add a flag to enable/disable bash completion ? |
Yes we do @vadmeste, we need to prompt if not installed already. We should have an option to disable the prompt such that it doesn't add automatically. |
I think it is ugly for a user to add a flag to avoid the prompt if he just doesn't like to install the completion, so we actually need to save the user choice in config.json, Let's discuss this ASAP |
You may add subcommand to install completion. |
This is also true for bash_profile and fish/completions/mc.fish. If you have completions, distribute them using the standard method. For homebrew on Mac OSX that is:
For an example see The offending line is in main.go: Lines 199 to 200 in 88a3c2b
I guess it's a side effect of using the https://github.com/posener/complete package. The best would be to get some sort of patch upstream, but until then you could add a flag to generate the completions. Even better would be to do so during packaging, and ship the resulting files to be added to the folders mentioned above (or equivalent for your favorite platform). |
We talked about it internally. We feel that So, we will provide advanced users an option to not set auto completion when We will be adding an option called If this flag is not set, we will notify the user that |
So I need to include that flag for every invocation? If so, might I suggest to add it as a config option as well. Also, I'm totally for auto-completion, just not modifying user config files1. There are ways to distribute completion scripts for the three shells as listed above, which would be great, since it also enables auto-completion on the first invocation, not the second. 1I have a dotfiles repo, which means these modifications show up as dirty files in git. This feels weird, as I didn't edit anything, but a short search later I found this issue explaining why. |
Waiting for an answer here to evalute our options: posener/complete#89 |
PR sent to upstream posener/complete#94 |
Any solution so far? |
Yes here #2812 |
Ah thanks! |
Wouldn't it be better to do it the other way around? I.e. don't modify the user's I feel like most users would not expect that a command line utility is trying to modify their Having an explicit way of enabling autocompletion for |
I made PR #2814 to be able to disable the installation using an environmental variable. Maybe not ideal, but definitely better then requiring a flag for every invocation. |
Default behavior will be to install, it is convenient for our users. If you are not interested there is always the flag. |
Instead of the environment variable, it is possible to do |
As I said in the PR, it's also bad to force the user to define an alias just to be able to use the software without it messing up your dotfiles. Environmental variables can be set in a number of ways, and for some shells like fish, they can be persisted between sessions. Also, using env vars is common among server/containers to provide basic settings/secrets. Heroku and Docker are a couple of examples of these. Here the use would be to make sure you don't accidentally taint the server/container, as any change can lead to fun bugs. Basically, having it configurable in multiple ways allows the user to use the most appropriate config tool for their environment, whether that be an alias, environmental variable or config file.* *This would be sweet to have, but I'll settle for an env var any day |
I don't feel like it is unconvenient for users to run something like |
@kbg this is somewhere we will disagree, the default will be to add autocompletion automatically. For advanced users we will take the ENV PR sent by @maxnordlund and command line option which already exists. |
We have moved away now its Closing this issue. |
Expected behavior
don't edit user configuration files without explicit confirmation
Actual behavior
adds
to
.zshrc
Steps to reproduce the behavior
run mc
mc version
mc version
)System information
guys this is no bueno.
The text was updated successfully, but these errors were encountered: