Closed
Description
Does this issue occur when all extensions are disabled?: Yes
- VS Code Version: Version: 1.74.2 (e8a3071)
- OS Version: Darwin Kernel Version 22.2.0: Fri Nov 11 02:03:51 PST 2022; root:xnu-8792.61.2~4/RELEASE_ARM64_T6000 arm64
- Tried search terms: non-ascii, unicode, cwd, terminal
Steps to Reproduce:
- Create a new folder named "文件" and open with VS code
mkdir 文件
code 文件
- Click "Terminal" -> "New Terminal"
- Observe the terminal tab list.
The tab title is printed as zsh - �件
Expected: zsh
. Here the shell is open from the same folder as cwd, but VSCode incorrectly handles non-ascii cwd names and the UI thought the shell is launched from a different folder.
Since the cwd
of the TerminalInstance is now wrong, if we click the tab to split a new terminal with the same cwd, VSCode will throw " �件" does not exist.
This is likely a regression introduced in #165633: The __vsc_escape_value
routine interprets the utf-8 encoded string "文件"
as an ISO/ 8859-1 string "�件"
, then escaped as "\xE6\x96\x87\xE4\xBB\xB6"
, because the text is processed byte by byte.
Potential solution:
- Escape only a limited character sets for cwd and leave other characters as-is
- Enhance current escape scheme to support multi-byte strings