-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
reverse-i-search shows escape sequence #353
Comments
@glhez try to set the export TERM=xterm and see whether that fixes it for you. |
Does not change anything in ConEmu and git-cmd. I tried it also in bashrc. And I forgot to tell that I use Clink v0.4.4 [git:a60c0a]. |
I have no idea what Clink is. But when I call > bash --login -i in Git CMD and then call export TERM=xterm the cursor keys end the reverse search, as intended... So I have no idea what is going on on your side. |
First, sorry, now that I reread myself, I see that I did not put the versions of software used (Windows 7, git 2.5.1 x64, ConEmuC build 150821 x64). Now onto my problem: The cursor keys end the reverse search, as intended yes, it does. But it does not send the \e (or whatever), and only left the
The 'a' move to the position of the P. It is more like the rev-search handler does not print the |
Is this not more of a
Given that Clink provides "Powerful Bash-style command line editing for cmd.exe", several other crucial bits of information are missing: what options were chosen in the installer (Use Git from Bash only? Use Git from the Windows Command Prompt?)? Why do you run Clink from Git Bash? Could you provide a concise, comprehensible list of steps to reproduce your problem quickly and easily (what we call an "MCVE", a Minimal, Complete and Verifiable Example? |
I'll try removing clink, conemu, git-for-windows, reboot, reinstall git-for-windows, remove .bashrc, start command line, but for now:
|
Can't you find out using the Process Explorer, or at least the Task Manager? |
I retested:
ConEmu and Clink are out of the way, they are not responsible - loaded or not. And I'm back with my initial question: is there a way to put bash in debug, that is to print out in a file anything that would be output by bash (or readline?)? (looking on google for that only give me answer on how to debug scripts). By the way, here is the display while using vim: And to be exhaustive, the settings on the default console program: As well as a dump of env: https://gist.github.com/glhez/fcc63aee324f18048691#file-env-list |
Thank you for this easy-to-follow reproduction recipe. When I call "C:\Program Files\Git\git-cmd.exe" --command=usr/bin/bash.exe -l -I in Windows 10, this happens to me, too: I search backwards (note: I have to type at least one character first), then I hit any of the cursor keys and am greated with The reason is that the cursor keys send an Escape sequence, e.g. Cursor Up sends So after some digging through Bash history and readline configuration, it appears that adding these lines to your
Of course, ideally these lines would be guarded between |
Actually, I take it back. I just re-tested with |
I installed Git for Windows 2.5.2 x64, but it does not work for me. Also, in |
Hmm. For me, it also does not work any longer. Which is a bummer because it really worked at some stage. So let's reopen the issue. At this point, I cannot invest any more time into trying to find a solution, though, so I would recommend diving into the details of readline and the inputrc file. |
I tried to use msys2 since gfw is based on, and following this link to run msys2, the same problem occurs. |
@glhez so you're trying to avoid studying the readline and inputrc documentation? :blinking: |
The documentation of readline gives me isearch-terminators which default to Then I tried this Typing
|
Did you not rather want to set |
Tested.... and only the first "\e[A" remains (see And testing with P was to see if was doing something: either the ESC is hard-wired into the code, either the ESC is catched beforehand. And Ctrl J also seems to be hard-wired. |
Just to make this more annoying, I think the reason you might have thought this worked @dscho is because this behaviour doesn't happen every time. I'll run the same few reverse searches over and over and press the same arrow keys and get the escape character sometimes and not others. This happens with vanilla Msys2 (i.e. not Git for Window's flavour) using a windows terminal emulator like ConsoleZ or the default when you just run bash.exe, but not with the mintty.exe that comes with Msys2. I've tried importing all the environment variables in a consolez shell into the mintty session and ensured that all my profile files are the same as /etc/skel in both emulators and it's the same. Mintty works but the windows emulator doesn't. |
@yoshiwaan nice find! It never occurred to me that the key press duration might have anything to do with it. That's why things seemed to be fixed, and then broken again! |
Thanks @yoshiwaan ! |
I guess we can safely close this ticket now, as we tried everything in our power to fix this, right? |
Better yet: I no longer have the problem (and I can't seem to reproduce it as easily as before) and ConEmu/git bash were updated: git 2.5.1 x64 -> git version 2.11.1.windows.1 |
Hello,
Whenever I use the reverse-i-search (Ctrl R) under
git-bash
,git-cmd
(eg:git-cmd.exe --command=usr/bin/bash.exe -l -i
) or under ConEmu, I have the following problem:As you can see, when I type left/right/up/down key, the search display
[D[A[C[B
.This can be rather nasty when you search for a long command and type enter - in best case, it fails.
This was working fine with msysgit.
I'll try to test it with MSYS2 official package.
Detailed image are also here as a set of PNG image: https://bitbucket.org/glhez/zeta-bash/downloads/git_issue_revsearch.7z
The text was updated successfully, but these errors were encountered: