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+Space (MenuComplete) not working in Windows Terminal Preview with German keyboard layout #1415

Closed
l-c-g opened this issue Mar 21, 2020 · 7 comments
Labels
Issue-KeyboardLayout Issues related to dead keys with some keyboard layout. Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing.

Comments

@l-c-g
Copy link

l-c-g commented Mar 21, 2020

Environment

PS version: 7.0.0
PSReadline version: 2.0.0
os: 10.0.18362.718 (WinBuild.160101.0800)
PS file version: 7.0.0.0
HostName: ConsoleHost (Windows Terminal)
BufferWidth: 99
BufferHeight: 29

Exception report

None.

Steps to reproduce

Enter a partial command line and then try to invoke MenuComplete via Ctrl+Space, e.g.
Get-ChildItem -Ctrl+Space

Expected behavior

MenuComplete shows all possible completions (which it does in ConHost Powershell).

Actual behavior

A quotation mark " appears at the cursor location in the buffer.

Additional information

This may be related to #1380 (but I am already using PSReadLine 2.0) or #1086 (Windows Terminal and VS Code may share some code in this area, I don't know). It might also be related to microsoft/terminal#2865. From a comment in that issue, I understand that this is due to terminals handling Ctrl+Space as alias for Ctrl+@. Coincidentally, on a German keyboard you enter " as Shift+2, which is where the US layout has the @ glyph. This comment lead me to try and switch my keyboard layout to US; if I do, Ctrl+Space correctly invokes MenuComplete.

To me, it looks like a complex interaction between Windows Terminal, PSReadLine and the keyboard layout. I cannot say, however, whether the problem is in PSReadLine or Windows Terminal (in which case I would gladly open an issue with them).

@ghost ghost added the Needs-Triage 🔍 It's a new issue that core contributor team needs to triage. label Mar 21, 2020
@daxian-dbw daxian-dbw added Issue-KeyboardLayout Issues related to dead keys with some keyboard layout. Needs-More Investigation Initial investigation is done, but need to follow up. and removed Needs-Triage 🔍 It's a new issue that core contributor team needs to triage. labels Mar 24, 2020
@daxian-dbw
Copy link
Member

Thanks for reporting the issue. This is a duplicate of #1086. Quote from that issue:

as my default language usually is set to german, I'm encountering problems while trying Ctrl+Space for calling MenuCompletion.
Ctrl+Space is then interpreted as ctrl+". Even switching keyboard layout then to english with Shift+Alt makes no difference.

Given most of the conversation is happening in that issue, I will close this one as a duplicate.

@daxian-dbw daxian-dbw added Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing. and removed Needs-More Investigation Initial investigation is done, but need to follow up. labels Mar 24, 2020
@daxian-dbw
Copy link
Member

A bunch of key bindings used in PSReadLine get fixed in the most recent preview release of Windows Terminal (v1.1.1671.0), including ctrl+space (which doesn't need the ctrl+@ workaround binding for MenuComplete anymore).
See microsoft/terminal#879 for the issue, and microsoft/terminal#879 (comment) for the release information.
@l-c-g Can you please install the preview version of Windows Terminal and see if Ctrl+Space works fine in the German keyboard as well?

@gwojan
Copy link

gwojan commented Jun 19, 2020

@daxian-dbw one keybinding that no longer works for me with the latest Terminal Preview is Ctrl+[ in vi mode as an alternate Esc. I've tested with all PowerShell 7 builds and Windows PowerShell 5.1.

Should I file a separate bug?

@daxian-dbw
Copy link
Member

daxian-dbw commented Jun 19, 2020

@gwojan You already opened the issue #906, so no new issue is needed.
The PR #935 was submitted for that issue, but the fix was not accepted. I didn't spend time on it since then as it was not high priority at the time.
But it's in my radar and I will get back to it.

@gwojan
Copy link

gwojan commented Jun 19, 2020

@daxian-dbw Thanks. I had totally forgotten about #906 because I started using Windows Terminal shortly after that and Ctrl+[ worked as I expected. 😊

@daxian-dbw
Copy link
Member

Ah, yeah, it looks Ctrl+[ was fixed in WT preview to generate the same ConsoleKeyInfo as in conhost:

KeyChar  Key Modifiers
--------  --- ---------
         Oem4   Control

@l-c-g
Copy link
Author

l-c-g commented Jun 20, 2020

@l-c-g Can you please install the preview version of Windows Terminal and see if Ctrl+Space works fine in the German keyboard as well?

Yes, after removing my workaround keybindings, Ctrl+Space successfully invokes PSReadline MenuComplete in Windows Terminal Preview 1.1.1671.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-KeyboardLayout Issues related to dead keys with some keyboard layout. Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing.
Projects
None yet
Development

No branches or pull requests

3 participants