WindowsでVS Codeをインストールした場合,デフォルトでは古いPowerShell 5が使われるが,こいつはマルチバイト文字をCP932で受けるなどのふざけた振る舞いをする.したがってPowerShell 7に切り替えるべきである.そのためPowerShell 7のインストールとVS Codeへの設定方法を記しておく.
PowerShell 7のインストール:
winget search --id Microsoft.PowerShell
winget install --id Microsoft.PowerShell --source winget
VS Codeのデフォルトターミナルを変更:
{
"workbench.secondarySideBar.defaultVisibility": "hidden",
"workbench.startupEditor": "none",
"workbench.editor.enablePreview": false,
"terminal.integrated.profiles.windows": {
"PowerShell7": {
"path": "C:\\Program Files\\PowerShell\\7\\pwsh.exe",
"icon": "terminal-powershell"
}
},
"terminal.integrated.defaultProfile.windows": "PowerShell7"
}
そもそもPowerShellを使うのをやめるべきである.