Skip to content
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

clobbering inputrc after search UI #987

Closed
fowles opened this issue May 19, 2023 · 4 comments · Fixed by #1170
Closed

clobbering inputrc after search UI #987

fowles opened this issue May 19, 2023 · 4 comments · Fixed by #1170

Comments

@fowles
Copy link

fowles commented May 19, 2023

In a fresh terminal on my machine

[sonmi]~$ cat ~/.inputrc
# ipython like up and down keys
"\e[A": history-search-backward
"\e[B": history-search-forward

# word based navigation for ctrl+arrow
"\e[1;5C": forward-word
"\e[1;5D": backward-word
"\e[5C": forward-word
"\e[5D": backward-word
"\e\e[C": forward-word
"\e\e[D": backward-word
[sonmi]~$ echo hi there
hi there
[sonmi]~$ cat <up arrow>
[sonmi]~$ cat ~/.inputrc

note in the last step the way that up arrow completed to cat ~/.inputrc. Now I can continue my session

  1. <ctrl-r> (successfully brings up atuin graphical search pretty)
  2. <esc> (successfully drops me back to a terminal)
[sonmi]~$ echo oh no
oh no
[sonmi]~$ cat <up arrow>
[sonmi]~$ echo oh no

I would like the last step above to complete to cat ~/.inputrc not echo oh no.

I am running atuin with the following startup sequence:

[sonmi]~$ tail -1 ~/.bashrc
eval "$(atuin init bash --disable-up-arrow)
@fowles
Copy link
Author

fowles commented May 19, 2023

This appears related to the tpuc rmkx/smkx in __atuin_history, as I can reproduce the failure directly be running tput smkx and I can restore the correct behavior by running tput rmkx explicitly

ellie added a commit that referenced this issue Aug 14, 2023
This was initially in place for when we used a different terminal
backend. That backend required that the terminal be in a specific mode,
or otherwise key modifiers would not be correctly recognized. It was
super frustrating.

Since the move to crossterm, we automatically switch to raw mode: https://github.com/atuinsh/atuin/blob/b48de9bd9d89fb9b6a0044a1b251e5b2ff116387/atuin/src/command/client/search/interactive.rs#L528

Should resolve #987, #650, #909, #492

Should also supercede #1149
ellie added a commit that referenced this issue Aug 14, 2023
This was initially in place for when we used a different terminal
backend. That backend required that the terminal be in a specific mode,
or otherwise key modifiers would not be correctly recognized. It was
super frustrating.

Since the move to crossterm, we automatically switch to raw mode: https://github.com/atuinsh/atuin/blob/b48de9bd9d89fb9b6a0044a1b251e5b2ff116387/atuin/src/command/client/search/interactive.rs#L528

Should resolve #987, #650, #909, #492

Should also supercede #1149
@fowles
Copy link
Author

fowles commented Aug 14, 2023

Thanks for fixing this!!

@joeds13
Copy link

joeds13 commented Oct 27, 2023

I’m still seeing this issue after updating to 17.0.0 this morning using bash?

joe in ENG-Mac-569 in ~
❯ atuin --version
atuin 17.0.0
joe in ENG-Mac-569 in ~
❯ bash --version
GNU bash, version 5.2.15(1)-release (aarch64-apple-darwin22.1.0)
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Any help is appreciated and happy to test anything!

@joeds13
Copy link

joeds13 commented Oct 27, 2023

I’m still seeing this issue after updating to 17.0.0 this morning using bash?

joe in ENG-Mac-569 in ~
❯ atuin --version
atuin 17.0.0
joe in ENG-Mac-569 in ~
❯ bash --version
GNU bash, version 5.2.15(1)-release (aarch64-apple-darwin22.1.0)
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Any help is appreciated and happy to test anything!

I realised I wasn’t using --disable-up-arrow for my atuin init, sorry for the noise

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants