-
-
Notifications
You must be signed in to change notification settings - Fork 84
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-completion, command_not_found_handle] gcc autoreplace terminal bricking #203
Comments
Note: I guess the title should read "auto-insert", it does not replace anything, it simply adds text. |
Thank you for the report! This problem has been reported at #192, but the OP has closed the issue before we identify the cause. At that time, I suspected the First, I'd like to confirm that the situation is the same as in #192. Could you also check the following points?
Next, to reproduce it in my environment, I would like to know the detailed code path that these hooks are called.
$ bleopt debug_xtrace=blesh-xtrace.txt # <-- This starts the xtrace logging.
# This will create a text file in the current directory
$ gcc --hInstall package 'f2c' to provide command 'f77'? [N/y] # <-- Reproduce the problem Then, kill the Bash session and pick up the log file |
Ctrl+c Ctrl+v
|
blesh-xtrace.txt |
Thank you! The situation seems to be the same as #192.
I've checked it. I think the following lines are closely related.
It seems that
$ type command_not_found_handle Anyway, now the problem seems to be that |
But it's even more complicated than that, right? it is running Is Ble.sh trying to pre-run code as I am typing it? That is why this is gcc specific, as gcc takes code as an input? |
Thanks! It is exactly what we see in the
No, it's not running the suggestion. As I have already pointed out,
No.
No. The reason that it seems to be
This is just from your |
Oh, I see. Sorry for the not following you the first time. Installing the mentioned package, plus Do you want me to close this issue, as you seem to understand the problem now. Or leave it open since it is still unsolved. I can still do testing if you want, but I am basically just running generic fedora 36 + ble.sh I think. It sounds like any system missing f77 is going to have a similar bug. |
When either one of the commands "cc", "c++", "f77", and "f95" is not found in the system, on the first load of "gcc" completions, "command_not_found_handle" hook (typically set by distributions) is invoked in the middle of completion, breaks the terminal layout by outputting messages, and eats user inputs. This commit fixes the issue by checking the existence of commands before running these commands. Refs. akinomyoga/ble.sh#203 akinomyoga/ble.sh#192 scop#390
When at least one of the commands "cc", "c++", "f77", and "f95" is not found in the system, on the first load of "gcc" completions, "command_not_found_handle" hook (typically set by distributions) is invoked in the middle of completion, breaks the terminal layout by outputting messages, and eats user inputs. This commit fixes the issue by checking the existence of commands before running these commands. Refs. scop#390 akinomyoga/ble.sh#192 akinomyoga/ble.sh#203
I've pushed a workaround (commit 64d471a). I have also opened a pull request at the upstream
If you are not going to use $ sudo dnf remove f2c # <-- uninstall the f2c package
$ bash # <-- start a new session
$ gcc --help # <-- see if the problem arises
Any system missing |
The previous fix turned out to be incomplete by #192 (comment). I have added an additional fix d5fe1d1. |
Sorry, Canada's internet was out for all of yesterday. |
Oh, I feel sorry for that. You can check the updates when the internet is recovered! |
Seems to work, at least no terminal bricking. |
Thanks! |
When at least one of the commands "cc", "c++", "f77", and "f95" is not found in the system, on the first load of "gcc" completions, "command_not_found_handle" hook (typically set by distributions) is invoked in the middle of completion, breaks the terminal layout by outputting messages, and eats user inputs. This commit fixes the issue by checking the existence of commands before running these commands. Refs. scop#390 akinomyoga/ble.sh#192 akinomyoga/ble.sh#203
ble version: 0.4.0-devel3+11aa4ab
Bash version: 5.1.16(1)-release (x86_64-redhat-linux-gnu)
Fedora 36, Kitty
Found this really weirdly specific issue where ble.sh seems to be bricking my terminal instance when typing
gcc [a-Z]
.As soon as a single [a-Z] character is typed after gcc (note their can be multiple dashes in between), some text in inserted and the terminal no longer accepts any input, even
<C-c>
does nothing.Expected result:
gcc --help<enter>
My result:
gcc --hInstall package 'f2c' to provide command 'f77'? [N/y] <terminal no longer accepting any input>
The text was updated successfully, but these errors were encountered: