-
Notifications
You must be signed in to change notification settings - Fork 179
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
Avoid TIOCSTI on Bash #416
Conversation
Fascinating approach, I'll have to play with this and get back to you, thank you @jtschuster! |
It seems to basically work in bash on Mac and Linux. On Linux I am getting the following error during script setup: |
Thanks for the heads up, missed that in my testing. Looks like it was an issue with using single brackets in the if statements, should be fixed now. |
In #404 running The same code referencing TIOCSTI exists in this branch that was panicing, so I am not sure this is a complete fix? Lines 10 to 19 in caad816
|
@nuke-web3 this will only work if executed from bash using the key bindings, I think. |
Works on Ubuntu 24.04 server and desktop (bash 5.2.21, kernel 6.8.0-31) |
Works for me in linux and mac bash. @jtschuster do you think there's any avenue for fixing it for manual executions of mcfly search? I suspect no. |
No, I couldn't find any drop-in replacement for it. |
This is a good solution, thank you @jtschuster! |
To avoid using TIOCSTI on bash, mcfly can utilize the readline bindings. However,
bind
only lets you bind either a bash command / function or a readline function, but we can bind Ctrl+R to two keybindings - one which runs mcfly and binds/unbinds the second key to theaccept-line
readline depending on ifenter
ortab
is pressed. It's a bit of a hack, so there's an escape hatch if a user prefers to use TIOCSTI.