Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using IME with markdown preview enabled, press ESC/BACKSPACE leads in control characters #37114

Closed
timonwong opened this issue Oct 30, 2017 · 43 comments
Assignees
Labels
editor-input-IME Editor input of characters not on keyboard electron Issues and items related to Electron info-needed Issue requires more information from poster macos Issues with VS Code on MAC/OS X upstream Issue identified as 'upstream' component related (exists outside of VS Code)
Milestone

Comments

@timonwong
Copy link

  • VSCode Version: 1.17.2
  • OS Version: macOS 10.11.6

Steps to Reproduce:

HINT: You may need to enable editor.renderControlCharacters in order to see what happens, or the control characters is invisible.

  1. Open a "markdown preview" in a split (just ensure the markdown preview is visible).
  2. In another split, edit arbitrary file with IME (mine with Chinese Pinyin).
  3. Type some characters using IME, before put them on screen, type backspace/esc to see what happens.

Just see the screenshot for example:

hmmm

Reproduces without extensions: Yes

@vscodebot vscodebot bot added the markdown Markdown support issues label Oct 30, 2017
@mjbvz mjbvz removed the markdown Markdown support issues label Oct 30, 2017
@mjbvz mjbvz assigned rebornix and alexdima and unassigned mjbvz Oct 30, 2017
@alexdima alexdima added editor-input-IME Editor input of characters not on keyboard macos Issues with VS Code on MAC/OS X labels Nov 1, 2017
@rebornix
Copy link
Member

rebornix commented Nov 15, 2017

It only happens when you are previewing the markdown content, which means it's caused by the webview.

@rebornix rebornix added bug Issue identified by VS Code Team member as probable bug upstream Issue identified as 'upstream' component related (exists outside of VS Code) labels Nov 15, 2017
@rebornix
Copy link
Member

It turns out that when we preview the md content, the webview will lead to the problem as described in #24981 (you need to double backspace to delete characters). This problem was introduced in Electron 1.5.x, fixed by backporting in 1.6.x, apparently they forgot to backport the fix in 1.7.x. Ideally this can be fixed once we adopt 1.8.x.

More info electron/electron#9173 (comment) , cc @bpasero @Tyriar

@gaoliang
Copy link

In version 1.19.0, this is not the only problem in the markdown file, but all the files will appear.

复现

@Proxy305
Copy link

From my observation, this issue only triggers as long as I have more than one editor opened, or have the side bar extended. This issue goes away immediately after the closing all the extra editors AND the sidebar, however reoccurs after the extension of side bar or the opening of extra editors.

More IMEs and file type could be affected. The built-in Japanese IME of macOS is affected, and TeX(.tex) files are also affected.

  • VSCode version: 1.19.1
  • macOS version: 10.12.6

@gaoliang
Copy link

any update?

@chenxinlong
Copy link

chenxinlong commented Feb 9, 2018

When you push files with these control characters to github, it would be replaced with character " � " like :
image

In edit mode on github, seems chrome render these characters as a red dot, like :
image

@Tidyzq
Copy link

Tidyzq commented Mar 29, 2018

+1

@tzing
Copy link

tzing commented Apr 7, 2018

similar issue here:
if one put an emoji which is longer than 2 byte (for example 🇺🇸, \xe7\xbe\x8e\xe5\x9c\x8b) and hit the backspace, it will left an invisible symbol in the editor (🇺, \xf0\x9f\x87\xba)

@malun666
Copy link

Open User Setting, then add "editor.renderControlCharacters": true, . Just, help for show the invisible symbol .
+1

@hotchilipowder
Copy link

similar mistakes happened in the latex edit scene

@jaggerwang
Copy link

+1 same problem

@InnerPeace-Wu
Copy link

It only happens when you are previewing the markdown content, which means it's caused by the webview.

It seems the problem is triggered by previewing. For latex, I tried to avoid it by setting external pdf viewer.
macos: vscode + skim
windows: vscode + sumatraPDF

@tete1030
Copy link

tete1030 commented Dec 3, 2018

@rebornix is there any issue created in the electron repo on the problem on version 2.0.12 ? Or has it been fixed? It seems the original issue electron/electron#9173 has been closed due to unsupported version.

@tete1030
Copy link

tete1030 commented Dec 4, 2018

Sorry, while I can reproduce this issue in v1.8.8, I cannot reproduce it in 2.0.7, 2.0.12, 3.0.10, 4.0.0-beta.8 .
I tested them with Electron Fiddle with the following code using macOS Pinyin input method.

<webview src="data:text/html,<input type=text />"></webview>

I tested in 2.0.12 with Electron Fiddle as suggested by electron/electron#9173 (comment), and the issue seems not reproducible in this Electron version. Am I testing it in a wrong way?

@rebornix
Copy link
Member

rebornix commented Dec 4, 2018

@tete1030 thanks for your help! I already left comment there ;) The trick is only input outside of the webview is running into this weird issue.

@YunanChen
Copy link

YunanChen commented Dec 6, 2018

+1 The same problems when using the Chinese input methods and opening the Markdown Preview Enhanced

@kouhei
Copy link

kouhei commented Dec 15, 2018

same problem exists in 1.30.0, but it seems to be fixed in insiders(1.31.0).
IME: MacOS default Japanese IME

@hilookas
Copy link

hilookas commented Jan 1, 2019

same problem exists in 1.30.0, but it seems to be fixed in insiders(1.30.1).
IME: MacOS default Japanese IME

Really? My VSCode still has this problem.

macOS 10.14.1
Chinese IME of Sogou Input
Download insiders edition VSCode (1.31.0-insiders) from the official website

After I typed some word and deleted them, the bug was reproduced.

@kouhei
Copy link

kouhei commented Jan 14, 2019

same problem exists in 1.30.0, but it seems to be fixed in insiders(1.30.1).
IME: MacOS default Japanese IME

Really? My VSCode still has this problem.

macOS 10.14.1
Chinese IME of Sogou Input
Download insiders edition VSCode (1.31.0-insiders) from the official website

After I typed some word and deleted them, the bug was reproduced.

I tried it again, and then this problem was reproduced.
I was wrong. I'm sorry.

@0x4f5da2
Copy link

The same issue can be reproduced on macOS 10.14.2 with default Chinese IME.😅

@He2hiwei
Copy link

The same issue can be reproduced on macOS 10.14.2 too. It is is so disturbing. When will it be fixed?

@rebornix
Copy link
Member

rebornix commented Jan 25, 2019

@kouhei @0x4f5da2 @He2hiwei do you mind sharing more details about the version of VSCode you are using and steps to reproduce?

Example:

  • Version 1.31.0-insider (1.31.0-insider)
  • Commit: 50854c0
  • macOS 10.14.2
  • whether you have markdown preview open

image

The reason I asked for you help on this as I can't reproduce this bug anymore. If the issue is still there someway, I'll look into it and get it fixed. The bug existed for too long and we need to give it an end but I need more info ;)

@rebornix rebornix self-assigned this Jan 25, 2019
@bpasero bpasero added the info-needed Issue requires more information from poster label Jan 28, 2019
@sanxing-chen
Copy link

Hi @rebornix
I'm using 1.31.0-insider with latex-workshop plugin which has a pdf preview webview. And I'm using macOS(10.14.1) default Chinese IME.
The bug cannot be consistently reproduced in 1.31.0-insider, but it still happened from time to time if you input and delete character very quickly.
For LaTeX editing, this bug is pretty annoying, because the ^H in TeX will trigger a compilation termination with errors.

@robertying
Copy link

It's happening not only in editor but also in VSCode's every input field (I believe).

I used VSCode's built-in Git extension and submitted a commit message in it, and somewhere in my final commit message appears a � on GitHub.

@zruijie
Copy link

zruijie commented Feb 28, 2019

  • macOS Mojava 10.14.3
  • vscode 1.31.1 (1.31.1) 1b8e830

Maybe this bug has been fixed. Now I donot meet this bug any more.

@MyroshnykRoman
Copy link

Issue is still reproduced with Version: 1.38.1
and Japanese IME

@bpasero bpasero removed their assignment Oct 8, 2019
@bpasero
Copy link
Member

bpasero commented Oct 18, 2019

Can you try to reproduce with our nightly insider builds? You can give our preview releases a try from: https://code.visualstudio.com/insiders/

@acbetter
Copy link

acbetter commented Oct 20, 2019

Can you try to reproduce with our nightly insider builds? You can give our preview releases a try from: https://code.visualstudio.com/insiders/

The bug seems to be fixed in recent nightly insider builds.
Tested Code Version: 1.40.0-insider and no other extensions installed.

Version: 1.40.0-insider
Commit: 5aec74a
Date: 2019-10-18T05:32:01.162Z
Electron: 6.0.12
Chrome: 76.0.3809.146
Node.js: 12.4.0
V8: 7.6.303.31-electron.0
OS: Darwin x64 18.6.0

@bpasero
Copy link
Member

bpasero commented Oct 20, 2019

Awesome, thanks for trying. Can others confirm too?

@vscodebot vscodebot bot closed this as completed Oct 27, 2019
@vscodebot
Copy link

vscodebot bot commented Oct 27, 2019

This issue has been closed automatically because it needs more information and has not had recent activity. See also our issue reporting guidelines.

Happy Coding!

@vscodebot vscodebot bot locked and limited conversation to collaborators Dec 16, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
editor-input-IME Editor input of characters not on keyboard electron Issues and items related to Electron info-needed Issue requires more information from poster macos Issues with VS Code on MAC/OS X upstream Issue identified as 'upstream' component related (exists outside of VS Code)
Projects
None yet
Development

No branches or pull requests