microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
163.57k stars 29.02k forks source link

Typing ~ in terminal results in 4~ #108077

Closed mnunezdm closed 1 year ago

mnunezdm commented 4 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

System Info |Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i7-8700K CPU @ 3.70GHz (12 x 3696)| |GPU Status|2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: disabled_off
opengl: enabled_on
protected_video_decode: unavailable_off
rasterization: enabled
skia_renderer: disabled_off_ok
video_decode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled| |Load (avg)|undefined| |Memory (System)|15.86GB (4.90GB free)| |Process Argv|--crash-reporter-id f42cf393-2006-41d7-afa1-7a625b63925d| |Screen Reader|no| |VM|0%| |Item|Value| |---|---| |Remote|WSL: Ubuntu| |OS|Linux x64 4.19.128-microsoft-standard| |CPUs|Intel(R) Core(TM) i7-8700K CPU @ 3.70GHz (12 x 3695)| |Memory (System)|5.80GB (2.86GB free)| |VM|0%|
Extensions (32) Extension|Author (truncated)|Version ---|---|--- vscode-docker|ms-|1.6.0 remote-containers|ms-|0.140.1 remote-ssh|ms-|0.55.0 remote-ssh-edit|ms-|0.55.0 remote-wsl|ms-|0.44.5 vscode-remote-extensionpack|ms-|0.20.0 debugger-for-chrome|msj|4.12.11 material-icon-theme|PKi|4.3.0 material-theme|zhu|3.9.1 apex-pmd|chu|0.5.2 transformer|dak|1.9.0 vscode-eslint|dba|2.1.8 gitlens|eam|10.2.2 EditorConfig|Edi|0.15.1 json-tools|eri|1.0.2 prettier-vscode|esb|5.7.1 chat|kar|0.35.0 git-graph|mhu|1.26.0 vscode-autoprefixer|mrm|3.0.1 vsliveshare|ms-|1.0.2902 vsliveshare-audio|ms-|0.1.91 vsliveshare-pack|ms-|0.4.0 vscode-xml|red|0.13.0 salesforce-vscode-slds|sal|1.2.1 salesforcedx-vscode|sal|49.12.0 salesforcedx-vscode-apex|sal|49.12.0 salesforcedx-vscode-apex-debugger|sal|49.12.0 salesforcedx-vscode-apex-replay-debugger|sal|49.12.0 salesforcedx-vscode-core|sal|49.12.0 salesforcedx-vscode-lightning|sal|49.12.0 salesforcedx-vscode-lwc|sal|49.12.0 salesforcedx-vscode-visualforce|sal|49.12.0
mnunezdm commented 4 years ago

Apparently, when typing using the Ctrl + Alt + 4 correctly types the ~

Checking the documentation. This is my configuration (i have omitted all the other mappings)

{
    "layout": {
        "name": "0000040A",
        "id": "",
        "text": "Spanish"
    },
    "rawMapping": {
        "Digit4": {
            "vkey": "VK_4",
            "value": "4",
            "withShift": "$",
            "withAltGr": "~",
            "withShiftAltGr": ""
        },
    }
}
Tyriar commented 3 years ago

Can you try toggle escape sequence logging and see what is being sent when you press altgr+4 vs ctrl+alt+4?

https://github.com/microsoft/vscode/wiki/Terminal-Issues#enabling-escape-sequence-logging

mnunezdm commented 3 years ago

When pressing AltGr + 4

image

When pressing Alt + Control + 4

image

Do you need any more info @Tyriar ?

mnunezdm commented 3 years ago

I have just installed Hyper terminal, as it also runs on xterm and has the same issue, I have created the issue in the xterm repository as it is the root cause of this problem in vscode

Tyriar commented 3 years ago

@mnunezdm thanks, the screenshots are very useful 👍

Tyriar commented 1 year ago

I believe this is already fixed, can you see if you can reproduce in the Insiders build? Let us know if not.