Ble.sh: Auto-source from `.bashrc` causes "[ble: reload]" and frozen shell

Created on 11 May 2020  ·  5Comments  ·  Source: akinomyoga/ble.sh

ble version:
v0.3.2, downloaded via wget

Bash version:

Ubuntu 19.10

5.0.3(1)-release, x86_64-pc-linux-gnu

When putting the code to automatically source blesh in .bashrc, my shell freezes with this and does not take any input:

image

However, manual source has no problems, as you can see below:

image

Thank you for such a great tool by the way, really useful =D

Information Needed bug

All 5 comments

Not a maintainer or anything, but have you tried cloning from master at all? v0.4 devel is quite a bit further along than v0.3.2.

Thank you very much for the report and a comment!

I confirmed this problem happens when source ble.sh is executed more than once in .bashrc. It is reproduced with ble-0.4 as well. For example, a possible situation is that you have source ble.sh in both .bash_profile and .bashrc, and source ~/.bashrc is executed in .bash_profile. This causes source ble.sh twice in the start-up process of a bash interactive session. If this is the case, for a quick fix, you can modify .bashrc or .bash_profile not to source ble.sh more than once. Basically, source ble.sh should be placed in .bashrc but not in .bash_profile.

I think, even if source ble.sh is executed multiple times in .bashrc, it should not cause problems. So, I'm going to take a look on this issue.

@akinomyoga Really strange, I'm no bash-wizard so it's possible one of the many tools/configs I have set up is somehow loading my .bashrc twice.

Thank you for the courteous and swift reply :pray:

Fixed 5476933 (983e8a9 for v0.3) not to cause problems with multiple sources in ~/.bashrc. You can update ble.sh by the command ble-update in a (successfully-initialized) ble session. Now the shell will not be frozen even when source ble.sh is made more than once. However, it still prints [ble: reload], which is intentional behavior when source ble.sh is executed multiple times.

@akinomyoga Really strange, I'm no bash-wizard so it's possible one of the many tools/configs I have set up is somehow loading my .bashrc twice.

OK, you only have one source ble.sh in .bashrc, and maybe .bashrc is sourced twice somehow? To track down what happens here, could you put a line ble-stackdump >/dev/tty in .bashrc just after the line of source ble.sh and provide me the output (if you have some sensitive information in the output, you can omit it)?

It seems that there was still something strange in @GavinRay97's Bash settings that the .bashrc is sourced twice. I'm not sure if this is related to ble.sh, but the original problem has been fixed. I haven't yet received confirmation from @GavinRay97 after four months, but let me now close this issue. Thank you for the report!

Was this page helpful?
0 / 5 - 0 ratings