Provide a separate configuration that can set the encoding of the console #202691
Labels
*duplicate
Issue identified as a duplicate of another issue(s)
*english-please
Issue not using English
info-needed
Issue requires more information from poster
translation-required-chinese-simplified
I sumbitted a issue:#195446, set the windows console in settings.json:
when set the console args:
"args": ["/K chcp 65001>nul"]
or"args": ["/K chcp 65001"]
or"args": ["/K", "chcp 65001"]
,execute theshell
type task:An error message will appear: 'Incorrect parameter format -/d', due to a conflict between the Windows command parameters'/K 'and'/D ','/C '.
The '/K chcp 65001' parameter is set to solve the problem that the UTF8 Chinese characters output from the VSCode console are garbled in some cases. For example, some plugins used to debug C/C++ programs, but now Microsoft's official C/C++ plugins can normally output UTF8 Chinese characters in C/C++, but there are still many plugins that may not output normally. Therefore, setting the console code uniformly here is a relatively easy way, #19837 (comment) -This method is also mentioned.
However, after setting this parameter, if you want to run a
Shell
type task, the error mentioned above will be reported. This is because VSCode adds the '/d /c' parameter directly after executing the command:I have studied the explanation of
cmd
and tried using the following command in this situation:cmd /S /D /K "chcp 65001>nul&&echo Hello"
It can output normally.
So I have a suggestion that
VSCode
can intelligently perform some checks when executing Shell type tasks. If it finds that there are already '/K' parameters, it can make adjustments to the command.It would be best to provide a separate configuration that can set the encoding of the console.
Thank you!
The text was updated successfully, but these errors were encountered: