xtermjs / xterm.js

A terminal for the web
https://xtermjs.org/
MIT License
17.6k stars 1.62k forks source link

Typing ~ in terminal results in 4~ #3168

Open mnunezdm opened 3 years ago

mnunezdm commented 3 years ago

Issue Type: Bug

Hello,

I have a keyboard with spanish layout.

When typing the ~ character (which in my case is Alt Gr + 4) in the terminal 4~ is printed. This only happens when I use the integrated terminal in vscode, and only with the ~, for example with the # which is Alt Gr + 3 does not happen

error3 error4

For example these examples are using windows terminal & cmd

noerror

VS Code version: Code 1.49.3 (2af051012b66169dde0c4dfae3f5ef48f787ff69, 2020-10-02T17:57:01.595Z) OS version: Windows_NT x64 10.0.19041 Remote OS version: Linux x64 4.19.128-microsoft-standard

Also tested in Hyper terminal

hyperexample

This issue was originally created in the vscode repo https://github.com/microsoft/vscode/issues/108077

Tyriar commented 3 years ago

From @mnunezdm in the vscode issue:

When pressing AltGr + 4

image

When pressing Alt + Control + 4

image

mnunezdm commented 3 years ago

Ups! I closed it by mistake

jerch commented 3 years ago

@Tyriar Is this related to #3129?

Tyriar commented 3 years ago

VS Code Insiders is based on Chromium 83, so that doesn't align with what's said in https://github.com/xtermjs/xterm.js/issues/3129 about Chrome 85 working.

mnunezdm commented 3 years ago

This has happened to me for a while now, I think that this has always happened

I have been investigating the issue, and I think that has to do with how it handled at the SO level. The symbol, in the Spanish layout, is treated like the accent mark, you have to type any other character in order to "flush it"

For example:

In this case, I type the Alt + Ctrl + 4 nothing happens, then I press space the character ~ gets rendered on the screen And then I type Alt Gr + 4 the character 4 gets rendered then I press space and the character ~ gets rendered on the screen

xterm