24.3 Windows: pwsh session with Starship fails: -File path keeps single quotes
Description
On Windows, opening a local pwsh session fails when the XPipe Starship terminal prompt is enabled. The terminal shows:
The argument ''D:\TEMP\\\xpipe-1905625262.ps1'' is not recognized as the name of a script file. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
Usage: pwsh[.exe] [-Login] [[-File] [args]] ... Press [r] to restart or any other key to close this session ...The extra quotes in ''D:\TEMP\\\xpipe-….ps1'' are from pwsh’s The argument '{0}' formatting. The process actually received -File with the path including single quotes: 'D:\TEMP\\\xpipe-….ps1'.
The temp script exists and is valid. This is not a missing-file problem.
Environment
- XPipe 24.3 (regression vs 24.2; pwsh + Starship worked before this update)
- Windows 11 (build 26200)
- PowerShell 7.6.6 (
C:\Program Files\PowerShell\7\pwsh.exe) - Also Windows PowerShell 5.1
TEMP/TMP=D:\TEMP(no spaces)- Terminal emulator does not matter: reproduced with WezTerm and Windows Terminal
- XPipe terminal prompt: Starship
Steps to reproduce
- Windows, XPipe 24.3
- Settings → Terminal prompt → Starship (even with an empty config)
- Open a local This PC (pwsh) session
- Observe the error above
Expected
pwsh starts, runs the Starship init script, and drops into an interactive session.
Actual
pwsh rejects the init script and never starts the session.
What works / what doesn’t
| Case | Result |
|---|---|
| 24.3 + pwsh + Starship | Fails (WezTerm and Windows Terminal) |
| 24.3 + pwsh + Starship disabled | Works |
| 24.3 + cmd + Starship (Clink) | Works |
| 24.2 + pwsh + Starship | Worked |
Technical details
Starship causes XPipe to write a session init script, e.g. D:\TEMP\\\xpipe-1905625262.ps1:
$env:PATH="$env:PATH;D:\TEMP\\\xpipe\bin\starship"
$env:STARSHIP_CONFIG='D:\TEMP\\\xpipe\starship\starship-2080978541.toml'
Invoke-Expression (&starship init powershell)24.3 also added a UTF-8 encoding wrapper that relaunches with PowerShell-style single quotes:
& "$env:SystemRoot\System32\chcp.com" 65001 | Out-Null
powershell.exe -NoProfile -NoLogo -ExecutionPolicy RemoteSigned -File 'D:\TEMP\\\xpipe-1147121757.ps1'On Windows, cmd / CreateProcess / terminal launchers only treat double quotes as delimiters. Single quotes stay in the argument.
pwsh 7.2+ on Windows only accepts -File paths that end with .ps1. 'D:\TEMP\\xpipe-….ps1' ends with ', so pwsh reports “not recognized as the name of a script file” instead of file-not-found.
The same quoting via cmd reproduces the exact error:
cmd /c "pwsh.exe -NoProfile -File 'D:\TEMP\\\xpipe-1905625262.ps1'"cmd Starship launchers are fine because they use double quotes:
cmd.exe /C "D:\TEMP\\\xpipe-….bat"Windows Terminal launch still runs that same .ps1 wrapper:
wt.exe ... powershell.exe -NoProfile -ExecutionPolicy Bypass -File "D:\TEMP\\\xpipe-487064338.ps1"So switching terminals does not help.
Source: xpipe-io/xpipe