-
Notifications
You must be signed in to change notification settings - Fork 852
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
Arrow keys don't work in vim while using bash from Cmder. #1154
Comments
@dsouzadyn The arrow keys are bound to diff escape sequences. You need to use a special mode in cmder or conemu. This is a bug in their software (not detecting that terminal processing is enabled). |
See cmderdev/cmder#901 and this ConEmu release for a solution. |
Yes you need -cur_console:p |
I'm going to close this, as it's a conemu/cmder problem, and not a WSL/conhost one |
Guys, how can I echo something or run any other command after zsh has loaded? Also why zsh git is so slow and old (1.9.1) compared with my default portable version (2.10.1).. |
@AuthorProxy Could you open a new issue for this? I'd rather not pollute an old, closed thread. |
@zadjii-msft Also his question should go to the ConEmu issues page or go to @Maximus5 on twitter. |
This is not a bug in ConEmu. This is a bug of conhost/BashOnWindows, mentioned here long ago ConEmu tries to provide workaround for this conhost bug, but due to the lack of API its impossible for every possible case. |
It also depends on another bug: #406 |
@Maximus5 Yeah, but they said they're working on a proper new console API now. So in the meantime, since you have workarounds, there is no point sending people here. Look at miniksa's comments if you doubt it: |
What is the current status of the latest Windows build working with Cmder?
I'm very excited to one day have a Windows machine with the new Bash on Windows - inside Cmder, with working keys and colors - and oh-my-zsh. That would just be so awesome. |
I wouldn't expect any more improvements in the coming release in terms of supporting conemu/cmder. It's on our radar, but it's not going to make it for this release. |
@DanielGGordon Arrow keys function zsh () {
bash -cur_console:p
} to %CmderDIR%/vendor/profile.ps1 and "zsh" in Cmder (Powershell, for cmd it is the clink.lua) if test -t 1; then
exec zsh
fi (oh-my-)zsh |
This worked for me |
worked for me too. Just has to be |
Interesting. In my case, it affected syntax highlighting colors but mainly it hid the text cursor in Vim so it's not usable for me, unfortunately. You can't really edit a text if you don't see where the cursor is. Ubuntu 18.04 on Windows 10 Enterprise version 1809 |
It took me some time and many unsuccessful attempts, but finally I managed to fix the issue while not breaking colors or any other things! Instead of changing terminals and modes, I focused on key codes generated by the cursor keys and what Vim has mapped to the cursor movement. TL;DRTo fix the cursor movement using the arrow keys, add the following commands into the
Tested in Vim 8.0 under Ubuntu 18.04 bash executed in ConEmu 191012 on Windows 10 Enterprise version 1809. NoteUnfortunately, the key codes generated by the keyboard are different under Windows Console (e.g. ExplanationMy goal was to find out what actual key codes the arrow keys are generating on my system and what key codes has Vim mapped to its cursor movement actions. Key codes assigned to cursor movement actionsIn Vim, execute
That means, the key named Key codes generated by keyboardTo get the actual key codes generated by the keyboard, switch to the Insert mode, press Ctrl+V and then the key. For example, for the Left arrow key, it prints the code FixSo what's needed is simply to map Vim's key names to the same key codes as generated by the keyboard:
The easiest way to configure your keys is:
The final product should look similar to the following:
Now, the cursor keys work in all Vim modes. At least for me :) CreditsIt was this answer on the Stack Exchange's Q&A site Vi and Vim which greatly helped me to figure the things out. |
This worked for me as well. I use ConEmu. |
I discovered an issue when using Vim. It does not allow me to use the arrow keys at all and gives me an error in vim. This issue only occurs when you use bash from within Cmder. I'm using Cmder which uses ConEmu version 160914 [64].
Reproduce using the following steps:
bash
(unless it's your default shell).vim <filename>
.The text was updated successfully, but these errors were encountered: