-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
BASH_IT_AUTOMATIC_RELOAD_AFTER_CONFIG_CHANGE causes undesired behaviour for reloading Bash-it #1665
Comments
Found a reference to the addition of this line #764 (comment) but I don't think this is working properly |
You are right, this does not seem to work as expected... master ↓1 ~/Vagrant/vagrant-bash-it 12:48:15 ⚡ 100% foo.bar
❯ bash-it enable plugin tmux
bash-5.0$ This is on macOS with Bash v5.0.18 - it clearly does not what's expected. The issue seems to be that Bash is not invoked as a login shell, which means that the user's profile is not loaded. It looks like the Which OS are you seeing this on? Can you see if adding |
macOS and yes the |
OK - it would be interesting to see whether a Linux Bash works in the same way. I think I have a VM somewhere... |
Just gave this a quick test in a Vagrant box running Ubuntu: It looks like both It looks like adding the Would you be willing to open a PR for this? |
ok I discovered something that makes this line has more side effects. if [ -n "$BASH_IT_AUTOMATIC_RELOAD_AFTER_CONFIG_CHANGE" ]; then
exec ${0/-/}
fi
printf '%s\n' "$file_entity enabled with priority $use_load_priority." Now if we want to add the Again, reverting this back to |
This thread reminded me that #1533 exists. Could this be related? |
@ahmadassaf The call to I understand the issue with the looped reload, that's definitely something. Can we move the |
Honestly I prefer |
Having the
BASH_IT_AUTOMATIC_RELOAD_AFTER_CONFIG_CHANGE
flag should automatically reload Bash-it after activating or deactivating plugins, aliases, or completions. However, the behaviour that I am experiencing is completely different as it seems that the shell is being "reset/exit" and not reloaded.I have found that the code in
bash-it/lib/helpers.bash
Line 459 in 49a021e
bash-it/lib/helpers.bash
Line 559 in 49a021e
_bash-it-reload
works as expected.I am just wondering about what is the expected behaviour from the
exec ${0/-/}
, but happy to PR if this seems to be a valid issue.The text was updated successfully, but these errors were encountered: