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
[hstr 3.0] pressing Esc on system w/o TIOCSTI outputs page full of garbage #485
Comments
@jakedane great catch! It is reproducible. I wanted to make Bash and Zsh functions as similar as possible (simplification and maintenance)... however, it clearly does not work. I will strive to release the fixed version as soon as possible. Thank you for the bug report and Cygwin function test! |
Fix hint: I unfortunately didn't test Bash version properly and left Zsh version/variable in the Bash function (it didn't work even w/o ESC ... I used a development/debug version of the function) 🤦
I can keep simplified function version for both shells, however, the target variable must be fixed. |
I replaced hstrnotiocsti with this and that seems to work okay! function hstrnotiocsti {
{ READLINE_LINE="$( { </dev/tty hstr ${READLINE_LINE}; } 2>&1 1>&3 3>&- )"; } 3>&1;
READLINE_POINT=${#READLINE_LINE}
} |
@jakedane ... actually I think that it might need an initialization in certain cases ... still testing the new version... EDIT: yes, your function is OK and should be working as expected 👍 |
There were actually two 🐞 in the original function 🤦
@jakedane thank you for your help! |
I was wondering about that |
3.1 manpage still shows the incorrect bash config |
there is also still an issue in
otherwise the following wouldn't work:
|
This works for me too, however after selecting a command from the finder, it just gets written to command line without being sent, which means I have to press Enter twice.
Can you help? |
Sorry if my statement put anybody on the wrong footing. I meant the changed I don't know how/if this can be done differently in bash but if it's important you could (for the time being) enable TIOCSTI with the kernel parameter dev.tty.legacy_tiocsti=1. |
I just installed hstr 3.0 on my Arch Linux system w/o TIOCSTI and replaced the hstr config in my
.bashrc
with the output ofhstr --show-configuration
. Then I opened a new console.When I invoke hstr with Ctrl+R and then abort it by pressing Esc, instead of getting my shell prompt back immediately, it waits for another key press and then outputs a page full of garbage. It looks to have grabbed some lines from my
.bash_history
and shortened long lines by putting … at the end, and line endings are replaced with a^M^[[<nr>d
sequence where<nr>
is a number starting from 1 and counting up for each next line.Example of what happens after pressing Esc, to abort hstr;
I think there's a problem with this function from
hstr --show-configuration
output:If I replace that with the previous code, from hstrcygwin function in #481 (comment), then hstr works as expected and pressing Esc cleanly aborts it:
The text was updated successfully, but these errors were encountered: