microsoft / vscode

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

Terminal cannot input anything from "input method software" 内置终端无法使用输入法输入任何字符 #177063

Open 2catycm opened 1 year ago

2catycm commented 1 year ago

Type: Bug

  1. Open VSCode Insider
  2. ctrl shift ` to open the terminal window.
  3. Without input method software, keyboard can input ASCII charaters .
  4. Now ctrl shift to switch the Input method. For example, turn on the "SouGou Input method" which is a popular Chinese Pinyin input method software. Then nothing can be inputed into the terminal.

Observations and Guess:

VS Code version: Code - Insiders 1.77.0-insider (5c94e9f6dcf6ff2ccd84f298b47eb525fd328d63, 2023-03-13T22:12:52.723Z) OS version: Windows_NT x64 10.0.22623 Modes: Sandboxed: Yes

System Info |Item|Value| |---|---| |CPUs|AMD Ryzen 9 5900HX with Radeon Graphics (16 x 3294)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_renderer: enabled_on
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off| |Load (avg)|undefined| |Memory (System)|31.86GB (18.49GB free)| |Process Argv|--crash-reporter-id 135a1468-6737-4ded-8158-9295063b87c0| |Screen Reader|no| |VM|31%|
Extensions (46) Extension|Author (truncated)|Version ---|---|--- vscode-languagetool|ada|3.8.0 vscode-languagetool-zh|ada|3.8.0 vscode-open|ale|0.3.0 vscode-jetbrains-icon-theme|cha|1.0.17 path-intellisense|chr|2.8.4 vscode-markdownlint|Dav|0.49.0 gitlens|eam|13.3.2 vscode-html-css|ecm|1.13.1 EditorConfig|Edi|0.16.4 kotlin-formatter|esa|0.0.6 code-runner|for|0.12.0 kotlin|fwc|0.2.26 vscode-chatgpt|gen|3.9.5 copilot|Git|1.77.9225 vscode-pull-request-github|Git|0.61.2023031409 intellij-idea-keybindings|k--|1.5.7 vscode-leetcode|Lee|0.18.1 Kotlin|mat|1.7.1 git-graph|mhu|1.30.0 vscode-language-pack-zh-hans|MS-|1.76.2023030809 remote-containers|ms-|0.283.0 remote-ssh|ms-|0.99.2023030315 remote-ssh-edit|ms-|0.84.0 remote-wsl|ms-|0.76.1 vscode-remote-extensionpack|ms-|0.24.0 anycode-kotlin|ms-|0.0.5 makefile-tools|ms-|0.6.0 powershell-preview|ms-|2023.3.0 remote-explorer|ms-|0.3.2023021509 remote-server|ms-|1.0.0 vsliveshare|ms-|1.0.5834 gradle-language|nac|0.2.3 java|red|1.16.2023031404 vscode-yaml|red|1.12.1 even-better-toml|tam|0.19.0 pdf|tom|1.2.2 intellicode-api-usage-examples|Vis|0.2.7 vscodeintellicode|Vis|1.2.30 vscode-java-debug|vsc|0.49.2023022723 vscode-java-dependency|vsc|0.21.2023030900 vscode-java-pack|vsc|0.25.2023031100 vscode-java-test|vsc|0.38.2023030203 vscode-maven|vsc|0.40.2023031403 vscode-wakatime|Wak|24.0.7 familiar-java-themes|zer|0.1.7 vscode-proto3|zxh|0.5.5 (2 theme extensions excluded)
A/B Experiments ``` vsliv695:30137379 vsins829:30139715 vsliv368:30146709 vsreu685:30147344 python383:30185418 vspor879:30202332 vspor708:30202333 vspor363:30204092 vslsvsres303:30308271 pythonvspyl392:30422396 pythontb:30258533 pythonptprofiler:30281269 vsdfh931cf:30280410 vshan820:30294714 pythondataviewer:30285072 vscod805cf:30301675 bridge0708:30335490 bridge0723:30353136 cmake_vspar411:30581797 vsaa593:30376534 pythonvs932:30404738 cppdebug:30492333 vscaat:30438846 vsclangdf:30492506 c4g48928:30535728 dsvsc012cf:30540253 pynewext54:30618038 pylantcb52:30590116 pyindex848:30611229 nodejswelcome1:30587009 pyind779:30611226 pythonsymbol12:30651887 a9j8j154:30646983 6233i204:30659907 pythonb192:30661256 funwalk2:30682974 pythonms35:30671666 ```
meganrogge commented 1 year ago

Looks like this was originally fixed with

https://github.com/xtermjs/xterm.js/commit/7968b7ce7e5811e684dc02f3ac42511ca68cae2f

and can confirm that the fix was reverted at some point

https://github.com/microsoft/vscode/blob/6ecaf51d3afcb61c32ae2525c2eedbb61f6dea34/src/vs/workbench/contrib/terminal/browser/media/xterm.css#L65-L66

meganrogge commented 1 year ago

it was reverted here, but nvm because seems like that was tested and approved by the user who created the issue 🤔

https://github.com/xtermjs/xterm.js/commit/00bdd2805a27c2bef8d2e4ac7d61c2cdefa2c17b

meganrogge commented 1 year ago

The code that fixed this originally is still in place.

Tyriar commented 11 months ago

If this is still happening it's likely an issue in xterm.js: https://github.com/xtermjs/xterm.js

I'll leave this open with help wanted but I doubt the vscode team will be able to help fix it. Here's a code pointer directly to where composition events are handled: https://github.com/xtermjs/xterm.js/blob/fb2c39cb5748e071e0a1ed49824590aafd45e65e/src/browser/input/CompositionHelper.ts

I also tested the standard pinyin/simplified Chinese IME on mac and it seems to work fine

2catycm commented 2 months ago

On Windows 11:

版本  Windows 11 专业版
版本号 24H2
操作系统版本  26120.1252
体验  Windows Feature Experience Pack 1000.26100.11.0

With VSCode:

版本: 1.92.0-insider (system setup)
提交: 4d17e85cfd911fb6b116e08a4d7c37cd725a966a
日期: 2024-07-26T13:12:28.318Z
Electron: 30.1.2
ElectronBuildId: 9870757
Chromium: 124.0.6367.243
Node.js: 20.14.0
V8: 12.4.254.20-electron.0
OS: Windows_NT x64 10.0.26120

The terminal still does not work with some popular Chinese IMEs. Well, it works on:

It seems these two classes of IME implements differently, and VSCode Terminal fails to work with the second category.