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

Unexpected behavior from Windows keyboard input #82

Closed
wuxunfeng666 opened this issue Jun 4, 2023 · 4 comments · Fixed by #121
Closed

Unexpected behavior from Windows keyboard input #82

wuxunfeng666 opened this issue Jun 4, 2023 · 4 comments · Fixed by #121
Labels
bug Something isn't working

Comments

@wuxunfeng666
Copy link

Hi. I encountered two problems when I use harlequin on Windows:

  1. I can't enter even one line of code smoothly. There seems to be a problem with the formatting.
  2. Sometimes the editor exits abnormally. For example, pressing the Ctrl when there is no content.

record.webp

@tconbeer
Copy link
Owner

tconbeer commented Jun 4, 2023

The video is going too fast for me to see what is going on. Can you please provide 1 or 2 reproducible scenarios that produce unexpected results?

Also:

  • What keyboard (language/layout) are you using? I see some non-Latin characters in the captions
  • If you are using command prompt, can you try with Powershell instead? (Powershell in windows terminal should work fine)

@wuxunfeng666
Copy link
Author

Thanks for your reply. Here's what I did in the video, and what happened:

  1. The SQL I wanted to run was:

    select * from range(3);

    And I typed:

    select Space Shift + 8 Space from Space range Shift + 9 3 Shift + 0 ; Ctrl + Enter

    The result seems to be that when the Shift is pressed, the cursor will move back one character, causing * and ( to appear in the wrong place.

    But the strange thing is that, a space will be automatically added in front of the * later, and the ) is in the correct position.

  2. When there was no content in the editor, I pressed the Ctrl, then harlequin exited abnormally.

For your question:

  1. I am using Chinese keyboard.
  2. I tried PowerShell, but the result is the same as cmd.

@tconbeer
Copy link
Owner

tconbeer commented Jun 5, 2023

Thanks for the info. There must be an issue with how the terminal is interpreting the input from your keyboard. We're clearly getting extra key press events that aren't caused by you.

We might be able to figure some of it out using the textual keys app, but I don't really know where this will take us. I'm going to ask for some help and understand what other Textual developers are doing to support other keyboards

@tconbeer tconbeer changed the title How can I enter SQL correctly on Windows? Unexpected behavior from Chinese keyboard input Jun 5, 2023
@tconbeer tconbeer added the bug Something isn't working label Jun 6, 2023
@tconbeer tconbeer changed the title Unexpected behavior from Chinese keyboard input Unexpected behavior from Windowskeyboard input Jun 23, 2023
@tconbeer tconbeer changed the title Unexpected behavior from Windowskeyboard input Unexpected behavior from Windows keyboard input Jun 23, 2023
@tconbeer
Copy link
Owner

tconbeer commented Jun 23, 2023

ok, I actually was able to reproduce this; on windows, every press of shift is or ctrl interpreted as ctrl+@, which we had mapped to the format action.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants