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

Ctrl key no longer works on when using Windows Command Prompt #1654

Closed
bootradev opened this issue Feb 11, 2022 · 9 comments
Closed

Ctrl key no longer works on when using Windows Command Prompt #1654

bootradev opened this issue Feb 11, 2022 · 9 comments
Labels
C-bug Category: This is a bug upstream

Comments

@bootradev
Copy link
Contributor

First occurs in commit 23553bd
It appears related to updating the crossterm dependency.

Reproduction steps

Ctrl doesn't work, observe trying to move using Ctrl-D or Ctrl-U, or trying to create a new split using Ctrl-W, Ctrl-V

Environment

  • Platform: Windows
  • Terminal emulator: Command Prompt
  • Helix version: v0.5.0-463-g23553bd3

No output is written to helix.log

@bootradev bootradev added the C-bug Category: This is a bug label Feb 11, 2022
@bootradev
Copy link
Contributor Author

Relevant issue: #677

@archseer
Copy link
Member

\cc @superlou @WindSoilder

@superlou
Copy link
Contributor

I'm trying to get the event-read example in crossterm running in the latest crossterm master, but I'm hitting build issues with wepoll. With crossterm 0.22 and the PR, I was definitely able to see ctrl at the crossterm level before.

@archseer
Copy link
Member

@CptPotato Hey, sorry to ping you like this. You're running Windows, right? Could you test the crossterm example?

I'd like to determine if we broke crossterm or if this is a helix issue.

@WindSoilder
Copy link
Contributor

Sorry for lately reply, I can reproduce this issue well, and I've verify that it works normally in crossterm 0.22..

I've verify event-read example, when I type ctrl-d, crossterm parse it as ctrl-D... which causes broken..

@archseer
Copy link
Member

We need to double check crossterm-rs/crossterm#619 then

@CptPotato
Copy link
Contributor

@CptPotato Hey, sorry to ping you like this. You're running Windows, right? Could you test the crossterm example?

I'd like to determine if we broke crossterm or if this is a helix issue.

No worries, happy to give it a shot:

Looks like I'm getting the same issue. Key bindings that use Ctrl don't work anymore in helix. As @WindSoilder also pointed out, running crossterm's event-read example shows upper case versions of the key pressed when using the Ctrl modifier, so it seems like a crossterm issue.

Note that not all keys behave like this. For example, Ctrl + m is interpreted as KeyEvent { code: Enter, modifiers: NONE }, Ctrl + 7 is KeyEvent { code: Char('_'), modifiers: SHIFT | CONTROL }, etc.

@superlou
Copy link
Contributor

I'm on WIndows 10 Pro, 10.0.19044.
On the current crossterm master, for ctrl+m, I get: Event: Key(KeyEvent { code: Char('M'), modifiers: CONTROL })
Lowercase "m" by itself gives Event: Key(KeyEvent { code: Char('m'), modifiers: NONE }).

I have the same behavior on the original windows_key_logic branch, so I guess it wasn't something that showed up after our commits. @WindSoilder, sorry. I should have noticed this earlier.

@WindSoilder
Copy link
Contributor

WindSoilder commented Feb 16, 2022

Sorry for introducing a new bug like this, I make a PR to fix this issue: crossterm-rs/crossterm#629

That pr simply convert from upper-case character to lower-case character

I've manually test it with helix, and it works fine for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug upstream
Projects
None yet
Development

No branches or pull requests

6 participants