- macOS Sierra 10.12.5
- Vscode 1.20.0 latest
2. How to reproduce this problem
When using the Chinese input method to input Chinese, always press the back key, for example, input
sfsf, when you press the back key four times, you will find that although the pop-up box of Sogou input method disappears, there is still one left on the page
sThat’s how you click back again,
bs, becomes a hidden character. This usually appears when there is a markdown rendering plug-in on the right.
From a more precise point of view, once your editor opens WebView, it will cause this problem. Even the welcome page of vscode is also WebView, which will also cause this problem. So it’s best to close WebView as much as possible when writing code.
3. How to make hidden characters appear
The Mac version of vscode control characters are generally not displayed, you can use the following methods to display them
In the editor, it looks like a very small
BS, which means backspace. Generally, this character appears occasionally when you press back or delete during input.
4. What is the problem with hidden control characters?
4.1. The control character will appear question mark on GitHub
For example, a hidden character appears between and the same character in the figure below, and a question mark with background appears on GitHub.
4.2. When the control character is in hexo next local search, the search.xml rendering will fail, and the search box will rotate all the time
If you use a browser to open search.xml, you will find parsing errors
5. How to solve
5.1. Delete hidden characters manually
You can use substitution, copy a hidden character first, and then replace the hidden character with null
5.2. Use plug-in remove backspace control character
Remove backspace control character
Chrome has been merged at home, so vscode 1.15, released in early August, will be redefined (vscode 1.15, electronic 1.7.4).
In fact, up to now, the problem has not been solved
Formatter to remove control characters contained in an open document. The default control characters to be deleted are as follows.
- “Editor. Formatonsave”: true if set, start when saving
- “Editor. Formatontype”: true when transformation is performed when it is set; when input is started
5.3. Wait for the official to give a better solution
The official bug is still
openStatus. Using IME with markdown preview enabled, press ESC/BACKSPACE leads in control characters #37114
5.4. Close all webviews
This problem usually occurs when the tab contains WebView, so after upgrading to the latest version of vscode, when writing code, you should be careful not to open any tab with WebView, including
- Turn off the real-time rendering function of markdown rendering plug-in
- Close the vscode welcome tab
6. Why doesn’t the government solve the problem directly?
- The bottom layer of vscode uses electron, which is
electronThe backspace can not erase the last one character during Japanese ime conversion (MacOS). If the problem is not solved by electronic, vscode will not solve it.
- Chrome is used in the bottom layer of electron, which is
chromiumTwo backspaces required to delete last character in WebView inputbug. If chromium does not solve the problem, elctron cannot solve it.
- To sum up, up to the time of writing, this problem is still unsolved.
- Is markdown always hidden when writing vscode on Mac?
- The local search function of hexo next topic is invalid. Clicking the search link cannot pop up the overlay layer
- Backspace can not erase the last one character during Chinese/Japanese IME conversion (macOS) #24981
- Backspace can not erase the last one character during Japanese IME conversion (macOS) #9173
- Two backspaces required to delete last character in webview input
- Control character
- Using IME with markdown preview enabled, press ESC/BACKSPACE leads in control characters #37114