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

Up Down arrow keys, INPUTRC and bash history search #3

Open
SamHasler opened this issue Dec 7, 2015 · 9 comments
Open

Up Down arrow keys, INPUTRC and bash history search #3

SamHasler opened this issue Dec 7, 2015 · 9 comments

Comments

@SamHasler
Copy link

@SamHasler SamHasler commented Dec 7, 2015

I have the following set:

> grep '\\e' $INPUTRC
"\e[A": history-search-backward
"\e[B": history-search-forward

If I start typing a previous command and pres the UP / DOWN arrows I expect it to search for the previous / next history item that started with what I have typed. Instead it is just going forwards / backwards in the history, replacing what I had typed.

This works as expected when not using the connector.

(The connector is brilliant! If using the history with up arrow wasn't in my muscle memory I'd switch to it straight away.)

ConEmu cygwin/msys connector version 0.6.2

ConEmu 151205

git version 2.5.0.windows.1

@Maximus5
Copy link
Owner

@Maximus5 Maximus5 commented Dec 7, 2015

"\eOA": history-search-backward
"\eOB": history-search-forward
@SamHasler
Copy link
Author

@SamHasler SamHasler commented Dec 7, 2015

Minty works fine with my current .inputrc (not running attached to ConEmu).

"\e0A" / "\e0A" do not work in ConEmu with connector.

This is the task I am using:

C:\Apps\dev\Git\bin\conemu-msys2-64.exe --dir %USERPROFILE% --environ --verbose bash --login -i "-new_console:C:\Apps\env\term-icons\git-16x16-8.ico"

This is the output from connector with --keys
<x1B><x5B:[><x41:A> UP
<x1B><x5B:[><x42:B> DOWN

Gnu's documentation for intputrc doesn't include the "\e" syntax. Any idea what the origin of it is?

http://www.gnu.org/software/bash/manual/bashref.html#Sample-Init-File

@Maximus5
Copy link
Owner

@Maximus5 Maximus5 commented Dec 7, 2015

Gnu's documentation for intputrc doesn't include the "\e" syntax.

Why not? There is "3.1.2.4 ANSI-C Quoting"

@Maximus5
Copy link
Owner

@Maximus5 Maximus5 commented Dec 7, 2015

Not a "zero", letter O!

@SamHasler
Copy link
Author

@SamHasler SamHasler commented Dec 7, 2015

Thanks! Using letter O worked.

If you don't mind me asking, how did you know that would work? I'm not sure I could have worked it out from the information I had available.

I think the syntax that I used originally should have carried on working as I've seen it elsewhere: http://askubuntu.com/questions/59846/bash-history-search-partial-up-arrow
but if you want to close this issue I don't mind.

@Maximus5
Copy link
Owner

@Maximus5 Maximus5 commented Dec 7, 2015

If you don't mind me asking, how did you know that would work?

Very simple. I've run "conemu-... --keys" from connector prompt. You've done the same from mintty ))

I have to check standard for arrow keys. Current ones were initially implemented for Vim.

@SamHasler
Copy link
Author

@SamHasler SamHasler commented Dec 7, 2015

Ah. I had conemu-msys2-64.exe --keys set up as a task I didn't expect it to give different output than if you run if from the current shell but it makes sense.

If I can help out with key mapping, e.g. pressing keys and recording output under different shells terminals etc let me know.

@ddemydenko
Copy link

@ddemydenko ddemydenko commented Jan 24, 2020

bind '"\e[A":history-search-backward'
bind '"\e[B":history-search-forward'

https://superuser.com/questions/7414/how-can-i-search-the-bash-history-and-rerun-a-command

@FrankHB
Copy link

@FrankHB FrankHB commented May 23, 2020

\e[A and \e[B used to work with MSYS2 + cmd + ConEmu. It fails suddenly after an update of MSYS2 today... But \eOA and \eOA work.

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

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.