todo

windows下cursor内置shell中文乱码解决

up:2025-11-13 09:47:31 edit:2026-02-24 07:03:21 view:220

# >>> Cursor UTF-8 config >>>

# %USER_PROFILE%\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1

if ($env:CURSOR_AGENT -eq '1' -and $true) {
  try { 
    chcp 65001
$env:PYTHONUTF8=1
    Write-Host "Cursor: Set encoding to UTF-8 success" -ForegroundColor Green
  } catch {
    Write-Host "Cursor: Set encoding to UTF-8 failed" -ForegroundColor Red
  }
  #[Console]::OutputEncoding = New-Object System.Text.UTF8Encoding $false
  #[Console]::InputEncoding  = New-Object System.Text.UTF8Encoding $false
  #$OutputEncoding = [System.Text.UTF8Encoding]::new($false)

  #$PSDefaultParameterValues['Out-File:Encoding']    = 'utf8'
  #$PSDefaultParameterValues['Set-Content:Encoding'] = 'utf8'
  #$PSDefaultParameterValues['Add-Content:Encoding'] = 'utf8'
  
  Write-Host "Cursor: Set encoding to UTF-8 finished" -ForegroundColor Green
}
# <<< Cursor UTF-8 config <<<



not in sinaapp