microsoft / vscode

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

Unable to type in Chinese in integrated terminal #115814

Closed Racaly closed 3 years ago

Racaly commented 3 years ago

Issue Type: Bug

打开内置终端 无法输入中文,

VS Code version: Code 1.53.0 (8490d3dde47c57ba65ec40dd192d014fd2113496, 2021-02-03T20:36:38.611Z) OS version: Windows_NT x64 10.0.18363

System Info |Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz (12 x 3192)| |GPU Status|2d_canvas: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
protected_video_decode: enabled
rasterization: enabled
skia_renderer: enabled_on
video_decode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled| |Load (avg)|undefined| |Memory (System)|15.86GB (11.40GB free)| |Process Argv|--crash-reporter-id f85a41a1-239d-4bd7-a4a1-dc3c12e2b6be| |Screen Reader|no| |VM|0%|
Extensions (6) Extension|Author (truncated)|Version ---|---|--- vscode-eslint|dba|2.1.14 vsc-material-theme|Equ|33.1.2 vsc-material-theme-icons|equ|1.2.2 git-graph|mhu|1.28.0 vscode-language-pack-zh-hans|MS-|1.53.2 vetur|oct|0.32.0 (1 theme extensions excluded)
A/B Experiments ``` vsliv368cf:30146710 vsreu685:30147344 python383:30185418 vspor879:30202332 vspor708:30202333 vspor363:30204092 vswsl492cf:30211402 pythonvsdeb440:30248342 pythonvsded773:30248341 pythonvspyt600cf:30251589 ```
rebornix commented 3 years ago

I can reproduce:

recording (10)

rebornix commented 3 years ago

It's not new, I can reproduce this on both 1.52 and 1.51 (didn't try to find a working one). xterm.js in browser works fine.

heartacker commented 3 years ago

me too

zhao-kang commented 3 years ago

me too

lianjy357 commented 3 years ago

The terminal can't input Chinese characters, but the CMD in Windows system can input Chinese normally. The installed version is 1.53. How can I input Chinese

gitlixingwei commented 3 years ago

+1

ZhouBox commented 3 years ago

+10086

longshihui commented 3 years ago

+100000086

Python-37 commented 3 years ago

I met same bug, I found that Windows builtin input method can use normally, some other input methods cannot input Chinese. When I met this bug, I thought that it's because of the input method I am using. BTW, VS Code in GNU/Linux works normally too.

Kingwl commented 3 years ago

It's not only Chinese but also Japanese, Thai, Kazakh, Russian, etc. Even emoji (paste).

I guess this may caused by unicode.

longshihui commented 3 years ago

We can review they commits on version 1.52 -> 1.53

Kingwl commented 3 years ago

We can review they commits on version 1.52 -> 1.53

According to https://github.com/rime/weasel/issues/605#issuecomment-774664102, There are to many commits after 1.51. We may not able to review them.

longshihui commented 3 years ago

I met same bug, I found that Windows builtin input method can use normally, some other input methods cannot input Chinese. When I met this bug, I thought that it's because of the input method I am using. BTW, VS Code in GNU/Linux works normally too.

Thanks your reply, I try windows native input methods, it works!

ChaoQunPeng commented 3 years ago

I have this problem too. My version is 1.53.But what I have found so far is that the QQ input method and the Microsoft input method can input Chinese, while the sogou input method cannot input Chinese.

Kingwl commented 3 years ago

After some shallow track.

image image

Seems caused by xterm.paste

yume-chan commented 3 years ago

Gathered some old comments from not-related issues here:


I'm experiencing the same problem on terminal, when inputing with CJK IME, the selected word will not be filled, or it will ignore some characters. I also tried the latest inside build but can still get this problem.

vscode-terminal

This bug happens at around 1.52.0 (maybe, I don't update VSCode in time), and it occurs when you're inputing CJK letters with some CJK IME (for my example, this bug happens with QQ Pinyin, but with Microsoft Pinyin it works fine).

This comment was posted at https://github.com/microsoft/vscode/issues/112621#issuecomment-767302336 , but it may not related to the original topic (happens on Source Control panel) and I didn't notice this issue at that time.

Originally posted by @ccloli in https://github.com/microsoft/vscode/issues/112978#issuecomment-767324290


I'm using vscode from VSCode-win32-x64-1.52.1.zip on windows 10. Inputing chinese is ok when editing documents with any chinese IME. When inputing in the terminal, it is not ok with sogou IME and ok with Microsoft PinYin IME.

Inputing chinese is ok for vscode-1.45.1

Originally posted by @ysiw in https://github.com/microsoft/vscode/issues/112856#issuecomment-755145706

yume-chan commented 3 years ago

@Kingwl I see some repros show ???, but some others simply do nothing.

For everyone have this issue, can you please confirm which behavior you are experiencing?

You may click the 👍 for ???, and 👎 for nothing happens

ccloli commented 3 years ago

Gathered some old comments from not-related issues here:

Well, I think #112978 is the same problem describe here. Okay, looks like it's not a same issue, I got nothing instead of ???, but I'm in 1.52.1 instead of 1.53.0. I also tried the latest insider build (1.54.0-insider, afd102cbd2e17305a510701d7fd963ec2528e4ea), the behavior is the same as previous version and doesn't get ???.

In detail, when you input x letters in terminal, they are not showing in terminal, then if you input y letters, then y - x of last letters will be shown.

Also this is not limited to CJK letters, when you input English letter with these CJK IME (you can press Enter to send your input Elnglish letters), they will be gone, too.

For example, if you input abc def ghi jklmn opqrst uv wxyz in sequence, the input letters will be like abcmntyz (sometimes I got abcmnopqrstyz which is a bit weird, it seems that before inputing opqrst, x is reset to 0).

86020ed618ecdd26

BTW, pasting text with Chinese letters into terminal works fine, it only happens when inputing with some CJK IME (some IME like Microsoft Pinyin works fine here).

Kingwl commented 3 years ago

@yume-chan Seems It's will write ? if you are paste or using Microsoft Pinyin. Otherwise It will be ignored.

lianjy357 commented 3 years ago

Please support Sogou Pinyin input method, which is our common input method tool

Lyun92 commented 3 years ago

I have this problem too. My version is 1.53.But what I have found so far is that the QQ input method and the Microsoft input method can input Chinese, while the sogou input method cannot input Chinese.

really? I tried the Microsoft Chinese input Method, whatever i input will be doubled, like: 112233啊啊

Lyun92 commented 3 years ago

Gathered some old comments from not-related issues here:

~Well, I think #112978 is the same problem describe here.~ Okay, looks like it's not a same issue, I got nothing instead of ???, but I'm in 1.52.1 instead of 1.53.0. I also tried the latest insider build (1.54.0-insider, afd102c), the behavior is the same as previous version and doesn't get ???.

In detail, when you input x letters in terminal, they are not showing in terminal, then if you input y letters, then y - x of last letters will be shown.

Also this is not limited to CJK letters, when you input English letter with these CJK IME (you can press Enter to send your input Elnglish letters), they will be gone, too.

For example, if you input abc def ghi jklmn opqrst uv wxyz in sequence, the input letters will be like abcmntyz (sometimes I got abcmnopqrstyz which is a bit weird, it seems that before inputing opqrst, x is reset to 0).

86020ed618ecdd26

BTW, pasting text with Chinese letters into terminal works fine, it only happens when inputing with some CJK IME (some IME like Microsoft Pinyin works fine here).

EXACTELY THE SAME!!!

Tyriar commented 3 years ago

I tested this and found the following:

yume-chan commented 3 years ago

Not one, but multiple third-party IMEs. They all worked fine before 1.52 and still work fine in all other programs and even in code editors after 1.52.

So definitely something has been changed in either Electron, Code or Xterm.js that affected these IMEs.

If you believe it's those IMES' fault, at least we need some directions to how we can "fix" them to conform the way you require.

ccloli commented 3 years ago

Tested with a fresh new Windows VM, seems that the first version which has the bug is 1.52.0. Since I don't find a way to get the subversion of Insider build, so I can't tell which day of release introduces the bug.

What's interesting is that, when you install QQ Pinyin for the first time, it asks you to choose an input mode:

image

So if I switch to the modern single-line mode, the problem is gone:

image

But if I disable it (use the old compatible mode), the problem is shown:

image

Lyun92 commented 3 years ago

QQ pinyin Works!

ccloli commented 3 years ago

Tested with some other IMEs, like a very old version of QQ Pinyin (before it merges to Sogou Pinyin), the latest Sogou Pinyin, Microsoft Bing IME, and some integrated IME in Windows 7, ALL of them can input correctly, but most of them are having a UI bug, which both shows the input letters in the IME UI and VSCode UI, but other programs like explorer.exe, it only shows the input letters in the IME UI.

image

image

So if we ignore the UI problem, the input bug now only happens on QQ Pinyin (and an open-source IME Weasel which based on Rime and noted in previous comment)? But it's still weird that it works fine before 1.52.0 and other modules in VSCode except integrated terminal.

heartacker commented 3 years ago

事实上 vscode 将这个bug标记为:Backlog, 并没有在recovery 2 plan中。是不打算修复吗?还是?@vscode

yume-chan commented 3 years ago

I guess the "game compatible mode" uses Input Method Manager (IMM) API while "single line mode" uses Text Services Framework (TSF) API. IMM has been deprecated and TSF is the replacement.

I remember while developing the Chromium-based Microsoft Edge, Microsoft developers actually had some pr's for Chromium around TSF support, and those pr's did cause some issue with Microsoft Edge canary and Chromium (I encountered one that is when deleting, characters got repeated)

I can't remember the exact version numbers that had these issues, but maybe Electron is currently using one of those bad ones. So hopefully these issues will go away when Electron upgrades to a newer version of Chromium.

ddzy commented 3 years ago

Any progress?

raind33 commented 3 years ago

is there any progress? I have the same problem

yume-chan commented 3 years ago

@heartacker xterm.js 的作者 @Tyriar 认为这是第三方输入法自己的问题,所以把这个 issue 移出了恢复迭代

Python-37 commented 3 years ago

@heartacker xterm.js 的作者 @Tyriar 认为这是第三方输入法自己的问题,所以把这个 issue 移出了恢复迭代

我最初也以为是输入法问题,因为我使用 Rime 输入法出现了这个问题,但是用系统内建输入法之后就正常了,于是提了这个issue https://github.com/rime/weasel/issues/605 但是上面有其他用户提到了其他的输入法也出现了同样的问题,而且我自己使用 Rime 输入法在之前版本的VSCode中运作正常,所以原因应该不在输入法上。

I initially thought it's because of input method's bug, because I met this problem when I'm using Rime input method, but after I exchanged to Windows built-in input method, VSCode's terminal works fine. However, other users above mentioned that some other input methods have the same problem, and Rime input method works fine in the previous version of VSCode, so the problem should not come from the input method.

ddzy commented 3 years ago

is there any progress? I have the same problem

我暂时用了微软拼音输入法,没问题 搜狗输入法不能输入中文

ccloli commented 3 years ago

@heartacker xterm.js 的作者 @Tyriar 认为这是第三方输入法自己的问题,所以把这个 issue 移出了恢复迭代

Is it possible to make it compatible with these IMEs? As based on latest comments, it still happens on Sogou Pinyin (thought I didn't reproduce it), and I guess Sogou Pinyin, QQ Pinyin and Rime are the top 3 using 3rd-party IMEs in China (at least Sogou Pinyin is definitely the most one), and all of them are well in previous version (1.51-).

I guess the "game compatible mode" uses Input Method Manager (IMM) API while "single line mode" uses Text Services Framework (TSF) API. IMM has been deprecated and TSF is the replacement.

Is this also apply to Linux distributions? Since the original issue I commented is on Arch Linux.

@Reilkay What's your IME using on Arch Linux? And are you still experiencing the same problem in latest VSCode?

@Reilkay 你在 Arch Linux 上使用的输入法是什么?在最新的 VSCode 下是否仍存在无法在终端输入中文的问题?

yume-chan commented 3 years ago

Is this also apply to Linux distributions? Since the original issue I commented is on Arch Linux.

@ccloli No, clearly #112978's behavior is different from this one.

Lxshmily commented 3 years ago

搜狗输入法就没法输入中文,自带输入法就可以。。。难受

wyattzheng commented 3 years ago

after 1.52 version, vscode behaves like this, maybe we should find out changes which cause this problem. Some input methods call special system APIs or output text to UI in a different way. but i think vscode should support them if possible.

hzzok commented 3 years ago

I have this problem too. My version is 1.53.2.

zsh2401 commented 3 years ago

This issue deserves attention because it has hit a large number of Chinese developers. I thought I have to consider downgrading the version of VSCode until this problem has been fixed.

longshihui commented 3 years ago

This issue deserves attention because it has hit a large number of Chinese developers. I thought I have to consider downgrading the version of VSCode until this problem has been fixed.

How to downgrading? I not found old version in the VSCode home page.

Python-37 commented 3 years ago

This issue deserves attention because it has hit a large number of Chinese developers. I thought I have to consider downgrading the version of VSCode until this problem has been fixed.

How to downgrading? I not found old version in the VSCode home page.

You can find previous version here. https://code.visualstudio.com/updates/v1_50

longshihui commented 3 years ago

This issue deserves attention because it has hit a large number of Chinese developers. I thought I have to consider downgrading the version of VSCode until this problem has been fixed.

How to downgrading? I not found old version in the VSCode home page.

You can find previous version here. https://code.visualstudio.com/updates/v1_50

Thanks!

Nyaasu66 commented 3 years ago

Is there any progress ? I'm sure it's an urgent issue.

Python-37 commented 3 years ago

Version 1.54.1 is released, but this bug is stiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiill able to reproduced.👿

skyhiter commented 3 years ago

I also encounter this problem. Any progress?

Sogou Pinyin input method

版本: 1.54.1 (system setup) 提交: f30a9b73e8ffc278e71575118b6bf568f04587c8 日期: 2021-03-04T22:38:31.419Z Electron: 11.3.0 Chrome: 87.0.4280.141 Node.js: 12.18.3 V8: 8.7.220.31-electron.0 OS: Windows_NT x64 10.0.19042

kemplaw commented 3 years ago

1.52 can work normally.

wenfangdu commented 3 years ago

In my case, this issue occurred in ^1.52.0, versions before that work as expected, as a workaround, we could use commands like git commit instead of git commit -m, etc. Hopefully, it will be resolved soon.

ccloli commented 3 years ago

So for now, the following IMEs on Windows are having the same problem with integrated terminal:

And an IME on Arch Linux (#112978, well yume-chan said it's not the same problem, but another contributer has marked it as duplicated with this one)? I've tried running an Arch Linux with lxde in a VM, but all fcitx IMEs are working fine, maybe it occurs on IBus?


To VSCode developers or contributers, the issue has been existed for about 3 months since 1.52.0 released, and from my side I don't see any progress on it, feeling a bit upset.

If you're not familiar with these IMEs, at least you can try Rime, it's an opensource IME, maybe it can helps you to find the problem.

BTW, for the working IMEs, probably they're also having another issue that both showing input letters on VSCode UI and IME UI.


To VSCode end-user, if you're still having this problem, maybe you can try the following options:

Python-37 commented 3 years ago

And an IME on Arch Linux (#112978, well yume-chan said it's not the same problem, but another contributer has marked it as duplicated with this one)? I've tried running an Arch Linux with lxde in a VM, but all fcitx IMEs are working fine, maybe it occurs on IBus?

fcitx-rime can work fine on openSUSE, but I didn't try iBus rime.