You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Start-UltraCode.ps1 fails to parse on Windows PowerShell 5.1 (em-dash on line 233 breaks under CP1252) #17
windows/Start-UltraCode.ps1 fails to run on Windows PowerShell 5.1 (the default powershell.exe that the Start menu / desktop .lnk launchers invoke). The launcher window flashes and closes immediately; nothing starts.
Root cause
Line 233 (as of de3a006) contains a literal em-dash— (U+2014):
The file is saved as UTF-8 without a BOM. Windows PowerShell 5.1, when running a BOM-less script via -File, decodes it as the system ANSI code page (Windows-1252), not UTF-8. The em-dash is UTF-8 bytes E2 80 94; the third byte 0x94 is the right double-quotation mark " in CP1252. That byte prematurely terminates the string literal, so the rest of the line and the surrounding if/else block collapse into garbage tokens.
Result: 11 cascading parse errors, e.g.:
Start-UltraCode.ps1:233 char:97 Unexpected token ')' in expression or statement.
Start-UltraCode.ps1:232 char:34 Missing closing '}' in statement block or type definition.
Start-UltraCode.ps1:220 char:14 Missing closing '}' ...
Start-UltraCode.ps1:235 ... Unexpected token '"
Reproduce
# Windows PowerShell 5.1
[System.Management.Automation.Language.Parser]::ParseFile(
'...\windows\Start-UltraCode.ps1', [ref]$null, [ref]([ref]$errs).Value)
# -> 11 errors, all downstream of line 233powershell.exe-NoProfile -ExecutionPolicy Bypass -File .\windows\Start-UltraCode.ps1-Status
# -> dies with the parse errors above; exit 1
PowerShell 7+ (pwsh) defaults to UTF-8 and does not reproduce — which is likely why it slipped through. The desktop/Start-menu shortcuts use powershell.exe (5.1), so end users hit it.
Fix (one of)
Simplest / recommended: replace the em-dash with ASCII -- (the rest of the file already uses --). Keeps the script pure-ASCII and immune:
Fixed in #28 (merged): replaced the U+2014 em-dash on line 233 of Start-UltraCode.ps1 with ASCII --. PowerShell 5.1 decodes a BOM-less .ps1 as CP1252, where 0x94 is a closing quote and broke parsing. A new CI guard (scripts/check_ascii_ps1.py) now blocks non-ASCII bytes in any .ps1.
Activity
Merge pull request #28 from OnlyTerp/devin/1781763007-fix-open-issues
devin-ai-integration commentedon Jun 18, 2026
Fixed in #28 (merged): replaced the U+2014 em-dash on line 233 of Start-UltraCode.ps1 with ASCII
--. PowerShell 5.1 decodes a BOM-less .ps1 as CP1252, where 0x94 is a closing quote and broke parsing. A new CI guard (scripts/check_ascii_ps1.py) now blocks non-ASCII bytes in any .ps1.