microsoft / inshellisense

IDE style command line auto complete
MIT License
8.24k stars 181 forks source link

Not support `chcp 936` #42

Closed aliuq closed 7 months ago

aliuq commented 8 months ago

Describe the bug

if the $profile contains chcp 936, it will be get a error from terminal

node:internal/process/promises:288
            triggerUncaughtException(err, true /* fromPromise */);
            ^

[Error: ENOENT: no such file or directory, mkdir 'D:\xxxxxxx\src\�����ҳ: 936
C:\Users\xxxxxx\Documents\PowerShell'] {
  errno: -4058,
  code: 'ENOENT',
  syscall: 'mkdir',
  path: 'D:\\xxxxxxxxxxxxx\\src\\�����ҳ: 936\r\n' +
    'C:\\Users\\xxxxxxxxxxxxx\\Documents\\PowerShell'
}

Node.js v18.16.1

Expected behavior No error

Environment

Additional context Add any other context about the problem here.

cpendery commented 8 months ago

@aliuq can you give me your anonymized $profile so I can replicate this?

aliuq commented 8 months ago

@cpendery Hi,

  1. I commented out everything in $profile
  2. Keep only chcp 935
  3. Execute pwsh at the command line
  4. Execute is bind, select pwsh, and throw an error message
# C:\Users\xxxxxx\Documents\PowerShell\Microsoft.PowerShell_profile.ps1
chcp 935
cpendery commented 7 months ago

Closing as this was fixed in 0.0.1-rc.5