AltGr/DeadKey + Space was broken - FIXED IN 1.20.10572.0 #21166

Closed
opened 2026-01-31 07:35:06 +00:00 by claunia · 8 comments
Owner

Originally created by @BrtCst on GitHub (Feb 1, 2024).

Windows Terminal version

1.20.10303.0

Windows build number

10.0.22635.3130

Other Software

WSL 2.1.1.0

Steps to reproduce

  1. Using FR bepo keyboard layout
  2. Typing AltGr + Space in a WSL tab

Expected Behavior

It should type an underscore, since AltGr + Space is the mapping for _ in FR bepo layout.

Actual Behavior

Rings the system bell. Worked fine in Terminal 1.18

Originally created by @BrtCst on GitHub (Feb 1, 2024). ### Windows Terminal version 1.20.10303.0 ### Windows build number 10.0.22635.3130 ### Other Software WSL 2.1.1.0 ### Steps to reproduce 1. Using FR bepo keyboard layout 2. Typing AltGr + Space in a WSL tab ### Expected Behavior It should type an underscore, since AltGr + Space is the mapping for _ in FR bepo layout. ### Actual Behavior Rings the system bell. Worked fine in Terminal 1.18
claunia added the Issue-BugIn-PRArea-InputArea-VTNeeds-Tag-FixProduct-Terminal labels 2026-01-31 07:35:06 +00:00
Author
Owner

@zadjii-msft commented on GitHub (Feb 1, 2024):

Hmm

@j4james did this one get regressed in #16511?

@zadjii-msft commented on GitHub (Feb 1, 2024): Hmm * #11968 --> * #11649 which was originally fixed by: * #11832 @j4james did this one get regressed in #16511?
Author
Owner

@j4james commented on GitHub (Feb 1, 2024):

Yeah, sorry. That's almost certainly a result of PR #16511. We're treating Space as a "functional" key, which means it gets hardcoded VT mappings which take precedence over the keyboard layout. It's not modal, though, so it's possible it could be handled as a regular "graphic" key. However, I have a sneaking suspicion that could break another keyboard layout, and that's why I put it with "functional" keys in the first place. But that may have been an old issue that was resolved in one of my many rewrites. I'll need to do some testing to double check.

@j4james commented on GitHub (Feb 1, 2024): Yeah, sorry. That's almost certainly a result of PR #16511. We're treating <kbd>Space</kbd> as a "functional" key, which means it gets hardcoded VT mappings which take precedence over the keyboard layout. It's not modal, though, so it's possible it could be handled as a regular "graphic" key. However, I have a sneaking suspicion that could break another keyboard layout, and that's why I put it with "functional" keys in the first place. But that may have been an old issue that was resolved in one of my many rewrites. I'll need to do some testing to double check.
Author
Owner

@j4james commented on GitHub (Feb 1, 2024):

Unfortunately it's not a simple fix. The reason I chose to handle it as a "functional" key was because the mapping for Ctrl+Space on a number of keyboard layouts is just SP, while it's expected by VT applications to be NUL. This includes the US layout. So if we handle it as a "graphic" key, that's going to break.

Not that that's impossible to fix, but it's likely to be messy.

@j4james commented on GitHub (Feb 1, 2024): Unfortunately it's not a simple fix. The reason I chose to handle it as a "functional" key was because the mapping for <kbd>Ctrl</kbd>+<kbd>Space</kbd> on a number of keyboard layouts is just `SP`, while it's expected by VT applications to be `NUL`. This includes the US layout. So if we handle it as a "graphic" key, that's going to break. Not that that's impossible to fix, but it's likely to be messy.
Author
Owner

@ilharp commented on GitHub (Feb 2, 2024):

All my keypad keys don't work in v1.20, including Enter. I would like to ask if this bug is the same as this issue?

image

@ilharp commented on GitHub (Feb 2, 2024): All my keypad keys don't work in v1.20, including <kbd>Enter</kbd>. I would like to ask if this bug is the same as this issue? ![image](https://github.com/microsoft/terminal/assets/20179549/89832417-5b22-422e-91d3-eaf4dac9075b)
Author
Owner

@juliencombattelli commented on GitHub (Feb 2, 2024):

Hello, I just noticed Windows Terminal Preview has the experimental profile option experimental.connection.passthroughMode that fixes those dead-keys and numpad-keys issues when set to true (at least on my side). But it is causing other strange behaviors with the arrow keys and CTRL-C as far as I can tell...

@juliencombattelli commented on GitHub (Feb 2, 2024): Hello, I just noticed Windows Terminal Preview has the experimental profile option `experimental.connection.passthroughMode` that fixes those dead-keys and numpad-keys issues when set to `true` (at least on my side). But it is causing other strange behaviors with the arrow keys and CTRL-C as far as I can tell...
Author
Owner

@mveroone commented on GitHub (Feb 2, 2024):

All my keypad keys don't work in v1.20, including Enter. I would like to ask if this bug is the same as this issue?

image

Hi.
Same issue this morning and I think it's related to Zsh.
I've fixed it this way : https://superuser.com/a/742193/239282

@mveroone commented on GitHub (Feb 2, 2024): > All my keypad keys don't work in v1.20, including Enter. I would like to ask if this bug is the same as this issue? > > ![image](https://private-user-images.githubusercontent.com/20179549/301719658-89832417-5b22-422e-91d3-eaf4dac9075b.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MDY4NjgyMjksIm5iZiI6MTcwNjg2NzkyOSwicGF0aCI6Ii8yMDE3OTU0OS8zMDE3MTk2NTgtODk4MzI0MTctNWIyMi00MjJlLTkxZDMtZWFmNGRhYzkwNzViLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDAyMDIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwMjAyVDA5NTg0OVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTk2MWQ5ZTkzMDQwYjllNDVmYjA1ZjA2NTg0ZmVlNTc2NjM1NDA4ZThhOGUxODQxNDJlMzgyYjk4ZDIwYzAxZjcmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.A24Qq9NQccgu0aP-e-3bm24Tsz-MfvOYsPSk5o1HIfw) Hi. Same issue this morning and I think it's related to Zsh. I've fixed it this way : https://superuser.com/a/742193/239282
Author
Owner

@j4james commented on GitHub (Feb 2, 2024):

Yeah, if you're using zsh, I believe it sets the terminfo smkx capability, which enables Keypad Application Mode, and that's what makes the keypad keys generate unique escape sequences. Previous versions of Windows Terminal didn't support that mode, which is why you wouldn't have noticed before. It's not related to this Deadkey+Space issue.

Other than manually rebinding the keys, as @mveroone suggested, another way you might work around the issue is by patching the zle-line-init function to disable the Keypad Application Mode after they've enabled it. Something like this might do the trick:

functions -c zle-line-init zle-line-init-orig
zle-line-init () { zle-line-init-orig; echo -en "\e>" }

I know almost nothing about zsh, though, so I have no idea what other issues that might cause, but in my brief testing it seemed to work.

I also noticed that ohmyzsh has an open PR to ditch their smkx usage (https://github.com/ohmyzsh/ohmyzsh/pull/5113), and that should theoretically fix the problem, but that PR is now 8 years old, so it doesn't look like it's happening anytime soon.

@j4james commented on GitHub (Feb 2, 2024): Yeah, if you're using zsh, I believe it sets the terminfo `smkx` capability, which enables [Keypad Application Mode](https://vt100.net/docs/vt510-rm/DECKPAM.html), and that's what makes the keypad keys generate unique escape sequences. Previous versions of Windows Terminal didn't support that mode, which is why you wouldn't have noticed before. It's not related to this Deadkey+Space issue. Other than manually rebinding the keys, as @mveroone suggested, another way you might work around the issue is by patching the `zle-line-init` function to disable the _Keypad Application Mode_ after they've enabled it. Something like this might do the trick: ``` functions -c zle-line-init zle-line-init-orig zle-line-init () { zle-line-init-orig; echo -en "\e>" } ``` I know almost nothing about zsh, though, so I have no idea what other issues that might cause, but in my brief testing it seemed to work. I also noticed that _ohmyzsh_ has an open PR to ditch their `smkx` usage (https://github.com/ohmyzsh/ohmyzsh/pull/5113), and that should theoretically fix the problem, but that PR is now 8 years old, so it doesn't look like it's happening anytime soon.
Author
Owner

@SchizoDuckie commented on GitHub (Feb 21, 2024):

Did this stuff get released yet? I feel like a damned idiot every time a switch to a terminal!
[edit]
Nevermind, I was apparently running the Preview build still.
Guess It's time to switch back to the stable build. That solves the issue for me.

@SchizoDuckie commented on GitHub (Feb 21, 2024): Did this stuff get released yet? I feel like a damned idiot every time a switch to a terminal! [edit] Nevermind, I was apparently running the Preview build still. Guess It's time to switch back to the stable build. That solves the issue for me.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#21166