-
Notifications
You must be signed in to change notification settings - Fork 822
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
Arrows ignored by bash when it started in ConEmu #111
Comments
I've created workaround in ConEmu build 160411. However, it would be nice to know, is it a bug or intended behavior. |
Unfortunately, arrow keys still do not work in vim. |
bash.exe has its own logic to read from console directly (this is as per the design today and subject to change in future releases). I am not a console expert, but I wonder if ConEmu interacting with the console directly is interfering with bash.exe's ability to process keyboard events? |
ConEmu use official console API WriteConsoleInput to post keypressed into the conhost input buffer. That worked perfectly until "Bash on Ubuntu" appears. |
Ok. I am not sure I fully understand the problem here. My understanding of this issue is that bash is not able to process arrow keys when launched from within ConEmu? Can you help clarify. |
Short answer: Yes. Many words below. When user press and release UpArrow, normal console application
But Unix console applications expect different key sequences. The Well, that is rude workaround, but if That is really rude, because ConEmu does not recieve ANSI sequences from If you would like to check, download latest ConEmu build (alpha 160411 ATM),
|
Sure, it is. Monday, 02 May 2016, 07:09PM +03:00 from Daniel Gordon < [email protected]> :
|
@Maximus5 I deleted my comment because I figured it out on my own by looking at the top of this page 10 seconds after I posted my comment... Sorry for the confusion. |
Hi, console2 and consoleZ, two other terminal emulators, have the same problem with arrows not working on bash. |
@bigonazzi Of course they are. Only ConEmu is able to send xterm-ish keyboard sequences, which LX kernel expects. |
Just would like to add that IMO this is quite important to have WSL working properly with ConEmu, because some serious console users (myself included) are not going to be satisfied with the basic Windows Console (which is now quite better than the legacy one, but still far away from any random XWindow Console we are used to) For now I'm doing some dev under WSL on the Windows Console (for now coping with the international keyboard bugs it has by switching to a US layout) but I will be seriously disappointed if I can't use ConEmu for a vast majority of WSL software, and that obviously includes vim... @Maximus5 thanks for your excellent ConEmu btw :) |
@xilun +1 The Windows default terminals don't have nearly enough features for any power user |
@Maximus5 thank you for ConEmu. It's a huge productivity improvement. MS should ditch the POS default console, give you a few million USD and ship it with every install of Windows. |
@Maximus5 - Given the popularity of ConEmu, you could also convert it to a UWP using “Project Centennial." and submit it to Windows Store for even a wider audience. |
+1 Please fix this |
Sorry, this is my bad. @zadjii-msft and I overlooked this portion of the design when we implemented the virtual terminal input handling in the console host such that it doesn't present itself properly for ConEmu and friends. Unfortunately because it's a design flaw, it's a little bit more work than a quick bug fix. I have it tracked internally as 7640020. I can't commit to a date it'll be fixed, but know that it is in our tracker, it is understood, and it is being ranked/prioritized. |
@miniksa good to hear that you're listening to user feedback! |
Ah, just came across this issue. I hope we'll see some progress soon! |
@Novynn What progress do you want to see? ConEmu had implemented workaround and arrows started working months ago. |
@Maximus5 I was meaning more towards on Microsoft's end, I wasn't aware of a workaround! I've just started using Cmder today, which reports it's ConEmu as being 160710 stable (I see this version is the latest release on GitHub) and I am unable to use arrow keys. I'm using cmd.exe in Cmder to start Bash on Windows to ssh into a screen session on a Linux machine. This is on the Windows 10 Insider Preview 14393. |
|
Ah, that makes a lot more sense! Works perfectly thanks. I still hope that Microsoft resolves this issue so no workarounds are required on your end. |
That's a very good point - the new console subsystem needs to have really, really good Unicode support. Modern programming languages support unicode strings and expect to be able to use it for I/O, and there are lots of prompt hacks using unicode characters as well. I figured I might as well ride the bit of traffic that's been generated right now to chime in and add that the community remains super interested in a series of blog posts on the architectural updates. An in-depth writeup that adds every last detail that's legally possible would be widely appreciated - both because architectural upgrade trivia is always really fun, and also because it'll clearly explain why everything took so long. I personally completely understand that this bugfix is the tail end of a lot of planets For people frustrated about this, I have an open question (I don't have any Windows-capable hardware at the moment, so I unfortunately can't try this out myself): Can urxvt or xterm from Cygwin running on a Windows X server talk to WSL? If it can, that could be a very workable alternative. For the MS devs working on this issue, when you see this update - I understand that speculating on timelines creates lots of avoidable fallout, so I won't ask for that. What I will ask for is a vague idea of the status of the internal tracking bug. How far have 7640020 and/or its dependencies/blockers progressed since the bug was initially filed (around August last year)? I'm not trying to extricate an executive "I'm impatient, hurry up" summary. This is not ready yet, not much to do except face that. That's fine. But to know that there has been some movement would be cool. Ah, if only you could share internal details. Then you could keep us in the loop about "the architecture, the customers, the issues, and the dependencies" :D and what the progress is with each. We wouldn't mind <3 |
FWIW, winpty works around this issue by detecting when the console's
Unfortunately, sending a window message doesn't work quite right, because the resulting console input records seem to use modifier state from the keyboard. winpty would like to synthesize the modifier state, but I don't think there's a way to do that using |
AFAIK, other console emulators on Windows (e.g. ConEmu and ConsoleZ) ought to be able to work around this issue the same way that winpty does.
AFAIK, one could run WSL urxvt or xterm connecting to any Windows X server, including Cygwin's. One could also run any Cygwin terminal emulator (including mintty, urxvt, xterm) and connect to WSL using https://github.com/rprichard/wslbridge (a program I wrote). wslbridge is also shipped as part of https://github.com/mintty/wsltty, a standalone package bundling mintty, wslbridge, and a Cygwin runtime DLL. |
FYI ConEmu has implemented a workaround long long ago |
@Maximus5 I once got the msys2 bridge + wslbridge working together in tandem (without MinTTY), but it stopped working after like an hour. Have you done any testing with it? |
Of course. It's working. Just use latest ConEmu version. |
Hey everyone, I finally have an update on this bug! I have a potential fix in code review right now. To summarize the problem: We were only translating KEY_EVENTs into appropriate VT sequences when the events arrived from the window message loop. I moved the translation layer around, and now the INPUT_RECORDs written to the input buffer from the API (WriteConsoleInput) will also get translated appropriately. It's not going to be available in the Fall Creator's Update, but it should be in the release that follows. Thanks for your patience! |
Good news. 👍 I just wasted an hour figuring out the issue and reached here. |
@zadjii-msft Good to hear. A few questions:
|
That is great news (not so great that it won't make Fall.. oh well :-) ) .. just curious if this means that it ended up being significantly less work than initially expected? :-D |
It was a bit easier than anticipated, but like I mentioned, mouse input is actually harder than anticipated unfortunately. |
Sorry, guys, I know you're being bombarded, but can you tell us how being on the Windows Insider fast track might affect the speed at which we see some of these changes? |
@bgshacklett If you're on the fast ring, you'll see these changes pretty immediately after they hit winmain, which is usually a month or so after I commit the code on my end. Otherwise, if you're on just a non-insider's build, you'll have to wait for the entire release to be finished, which is about twice a year (based on previous Windows 10 releases) |
Thanks for the discussion. Closing this issue since:
If you have further asks/issues, please file new issues on our Console GitHub Repo. |
I DO NOT CARE WHAT YOU PEOPLE KEEP SAYING. THIS ISSUE IS NOT FIXED IN WINDWOS 11 AND WSL2. Why is this still an issue in 2023? |
@maietta This issue was closed 5 years ago. The console codebase has had a tremendous amount of churn since then. Whatever you're seeing now probably has a new root cause. I'd recommend filing a new issue over at https://github.com/microsoft/terminal/issues, so we can ID whatever's causing what you're seeing. Thanks! |
for people running cli scripts in python: disable this Terminal › Integrated: Windows Enable Conpty key navigation will work, for packages like rich, fire, click cli tools... |
I'm the author of ConEmu - alternative terminal for Windows. My users have created the issue Maximus5/ConEmu#629. When bash is started in ConEmu console, it totally ignores all extended keys (Arrows, Fn, etc.), so users can't access command line history with Up/Down arrows.
What is the problem with bash? Up/Down arrows properly cycle cmd.exe history, when it's started in ConEmu, but bash ignores them.
ConEmu is GUI application, so it get keyboard events via WM_KEYUP/WM_KEYDOWN and forward them to the created (usually hidden) real console using WriteConsoleInput.
The text was updated successfully, but these errors were encountered: