bash_it.sh: source reloader.bash
without arguments for the default enabling
#2096
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
The recent change 23f9b74 has broken
plugin/blesh
. Becauseble.sh
now receives garbage arguments, it fails to interpret the arguments and cancels its loading.source FILE
without arguments will inherit the arguments of the caller context.reloader.bash
has been called without arguments for the current mechanism of enabling modules. The arguments have been only supplied for the legacy loading. However, now the arguments are always specified toreloader.bash
and are inherited by descendant sources including the external configurations. The unwanted arguments are'' ''
for the current mechanism of loading modules.In this PR,
source ble.sh --attach=prompt
to override the arguments inherited byrealoder.bash
.reloader.bash
only for the leagcy loading.Additionally, maybe we should separate the call of
reloader.bash
for the current enabling mechanism and the calls ofreloader.bash
for the legacy enabling as we have been doing originally before 23f9b74. I think the reason that they were originally separated is that these codes are considered deprecated. Mixing the up-to-date codes and the deprecated codes doesn't seem to be an improvement.Motivation and Context
All the plugins and other modules in
bash-it
are supposed to be correctly loaded bybash-it
. This change is required to prevent allsource
inbash-it
and external configurations (called fromreloader.bash
and its descendants) from receiving unexpected arguments that were originally specified toreloader.bash
. This becomes a problem when there is any configuration that interprets its arguments. This solves possible problems caused by these unexpected arguments. At least, this solves the problem thatble.sh
fails to start withblesh
plugin in the currentmaster
(187916d).This is not related to any open issue as far as I know. The problem is introduced in
master
just five days ago by merge commit 23f9b74. I have also checked recent pull requests but could not find related ones.How Has This Been Tested?
blesh
plugin is enabled (disabled any other plugins, aliases, completions).$HOME/.local
.ble.sh
is correctly loaded.Before the fix (i.e., the current
master
187916d), the plugin produces the following error messages, and ble.sh is not enabled.After the fix, the session normally starts without any error messages and with ble.sh being enabled correctly.
This PR may affect the arguments that other plugins, aliases, and completions receive, but will just make the behavior the one before the merge commit 23f9b74, so I don't think there will be any problems. Nevertheless, in principle, if there are any new plugins, aliases, or completions that assume the arguments
'' ''
, they can be broken.Screenshots (if appropriate):
The left panel shows the behavior in the current master (187916d) where ble.sh isn't enabled. The right panel shows the behavior after the fix where ble.sh is correctly loaded and working.
Types of changes
Checklist:
clean_files.txt
and formatted it usinglint_clean_files.sh
.