Ble.sh: ble: reload - sourcing .bashrc disables line editor

Created on 17 Jan 2020  ·  9Comments  ·  Source: akinomyoga/ble.sh

ble version:

b0.4.0-devel2+db8b0c2

Bash version:

5.0.11(1)-release

I've set up bleh.sh to automatically load in interactive shells through sourcing it in a .bashrc per the readme. If I do source ~..bashrc (or source ~/.bash_profile for that matter) I'm no longer able to use into my terminal session (iTerm2). To be more specific, after running the source command manually the screen shows a ble: reload message and no the terminal no longer appears to accept input - typed commands like ls are not only not visible but also don't update the terminal.

bug

All 9 comments

As an aside, there may be some small bugs here and there but this is a very cool project that few people know about. Have you considered sharing or promoting it on link sharing sites like HackerNews?

Thank you for the report.

To be more specific, after running the source command manually the screen shows a ble: reload message

This part is the expected behavior.

and no the terminal no longer appears to accept input

Unfortunately I could not reproduce this problem in any of my systems. I tried Linux (Fedora, Arch, Ubuntu and CentOS), Cygwin, FreeBSD, Solaris, Minix, Haiku. It seems again I need to ask for your help.

  • Question 1: Does the problem reproduce with other terminals?
  • Question 2: Does the problem reproduce with the command ble-reload (instead of source ~/.bashrc)?
  • Question 3: Does the problem reproduce with the commands ble-detach and ble-attach? It should look like the following:
$ ble-detach
[ble: detached]
Please run `stty sane' to recover the correct TTY state.
$ stty sane;
$ ble-attach
$
  • Question 4: When the problem occurs, can you check the CPU usage of the bash?

Have you considered sharing or promoting it on link sharing sites like HackerNews?

Thank you for the words of encouragement and a suggestion! I'm actually not familiar with the culture of Hacker News. Is a kind of self-promotion accepted there in general? If it would be accepted, I would consider it later. I recently started to write another feature, so it would be after I complete it.

P.S.: By the way, I completed the English translation of the manual two days ago. Because it is too long, you do not have to check them before making questions, etc. Nevertheless, if you are interested, you can look at them to see what kind of features are available.

Question 1: Does the problem reproduce with other terminals?

Yes, this also happens in the default Mac terminal app.

Question 2: Does the problem reproduce with the command ble-reload (instead of source ~/.bashrc)?

No, ble-reload does not cause this issue in either terminal

Question 3: Does the problem reproduce with the commands ble-detach and ble-attach? It should look like the following:

I'm not seeing the same behavior when running either of those commands.

Question 4: When the problem occurs, can you check the CPU usage of the bash?

Hm, I'm not seeing anything too out of the ordinary - running source on my .bashrc is more or less comparable to entering ble-reload, etc. I tried looking at system calls in dtrace for the first time but didn't see anything strange there either. Here's a snippet of the highest %CPU in top before that metric went back down to 0.

Processes: 425 total, 3 running, 422 sleeping, 2948 threads 
2020/01/17 21:13:48
Load Avg: 2.19, 2.21, 2.30 
CPU usage: 8.91% user, 9.6% sys, 82.2% idle 

PID    COMMAND %CPU
52714  bash    54.0

I'm not sure how helpful much of the above is. One thing I did notice is that I can manually the source bleh.sh file without encountering this behavior. I also feel like this may have started in either 0.3.1 or 0.4 - I can try those versions later if that helps.

Is a kind of self-promotion accepted there in general?

Oh yeah, I think sharing projects is totally fine. There's even some rules about it. 🙂

https://news.ycombinator.com/showhn.html

Thank you for your results!

One thing I did notice is that I can manually the source bleh.sh file without encountering this behavior.

This was the hint. I could reproduce the problem and fixed it (59c1ce4). Could you try the latest version?

Oh yeah, I think sharing projects is totally fine. There's even some rules about it. 🙂
https://news.ycombinator.com/showhn.html

This link is very useful! Thank you

Hm, unfortunately after pulling in the latest changes I'm still encountering the same issue in the 0.4 series. I tried eliminating bash_profile and bashrc settings to see if something was wrong on my side, but it didn't look like it. I also tried to checking out earlier commits from when I believed this wasn't happening to me in the 0.3 series, but also no dice. 🤔

OK, thank you for testing. Also thank you very much for trying to test bash_profile and bashrc settings.

unfortunately after pulling in the latest changes

  • Question 1: If you tried to update by git pull, I'm sorry but can I ask if you have run make (and also make install if you installed it to another place)? What is the current version of ble.sh after the udpate? It is confusing but actually you need to run maketo regenerate a ble.sh to apply the changes when you use git pull. When you used ble-update, please forget about this question.

  • Question 2: When the shell hangs, can you try to type C-d? If the problem is the same or similar one that I could reproduce, C-d should terminate the shell.

I tried eliminating bash_profile and bashrc settings to see if something was wrong on my side, but it didn't look like it.

  • Question 3: You have mentioned that the direct sourcing of ble.sh doesn't cause the problem. Can you create a minimal reduced bashrc that reproduces the problem?

I also tried to checking out earlier commits from when I believed this wasn't happening to me in the 0.3 series, but also no dice. 🤔

Actually the problem I could reproduce affects ble-0.3 also, so ce93c08 is the cherry pick of 59c1ce4 for ble-0.3. (Also, if you used git checkout, please don't forget make in case you missed it!)

Ah, yes I did forget to run the make command. Everything works as expected now!

OK! Thank you!

Was this page helpful?
0 / 5 - 0 ratings