Description
The terminal panel in Berd spawns PowerShell with the session's working_dir set to the repository path. When the path is under C:\Users\... (or any long path), PowerShell resolves it to the Win32 extended-length path format \\?\C:\Users\.... This breaks any child process that spawns cmd.exe — including npm, npx, and many Node.js toolchains.
Symptoms
-
Terminal prompt shows the extended-length path format:
PS Microsoft.PowerShell.Core\FileSystem::\\?\C:\Users\0\.buzz\REPOS\inferencesaver>
-
Running npm run dev (or any npm/npx command) fails with:
'\\?\C:\Users\0\.buzz\REPOS\inferencesaver'
CMD.EXE was started with the above path as the current directory.
UNC paths are not supported. Defaulting to Windows directory.
-
next dev crashes with:
Error: EISDIR: illegal operation on a directory, lstat 'C:'
-
npm run dev:docs fails with:
Could not read package.json: Error: ENOENT: no such file or directory, open 'C:\Windows\package.json'
Root Cause
- Berd's terminal panel spawns PowerShell with the session's
working_dir as the initial CWD
- When the working directory is a normal Windows path like
C:\Users\0\.buzz\REPOS\inferencesaver, PowerShell's FileSystem provider resolves it to the extended-length path format \\?\C:\Users\...
cmd.exe (spawned by npm/npx) does not support \\? UNC paths as a CWD and falls back to C:\Windows
- This causes all downstream Node.js processes to fail because they're running from the wrong directory
- Even Git Bash (
C:\Program Files\Git\bin\bash.exe --login) spawned from this terminal inherits the \\? CWD environment
Workaround
Run cd C:\Users\0\.buzz\REPOS\inferencesaver once in the terminal to reset the PowerShell provider path to the normal format. This is not obvious and wastes time every time a new terminal is opened.
Affected Environment
- Berd version: v0.6.2
- OS: Windows 10 (build 26100)
- Shell: PowerShell 5.1 (default Windows PowerShell)
- Node.js: v24.18.1
Suggested Fix
When spawning the terminal, Berd should normalize the working_dir path to its non-extended-length form (C:\... instead of \\?\C:\...) before passing it to PowerShell. This could be done by:
- Passing the path without the
\\? prefix when spawning the shell process
- Or, if using PowerShell, prepending a
cd to the non-extended path in the initial command
- Or, using Git Bash or Windows Terminal as an alternative shell option
Impact
This is a significant UX issue for any Windows user of Berd who works with Node.js projects, Python projects, or any toolchain that spawns cmd.exe subprocesses. It makes the terminal unusable out of the box for running dev servers, builds, and package managers.
Description
The terminal panel in Berd spawns PowerShell with the session's
working_dirset to the repository path. When the path is underC:\Users\...(or any long path), PowerShell resolves it to the Win32 extended-length path format\\?\C:\Users\.... This breaks any child process that spawnscmd.exe— includingnpm,npx, and many Node.js toolchains.Symptoms
Terminal prompt shows the extended-length path format:
Running
npm run dev(or any npm/npx command) fails with:next devcrashes with:npm run dev:docsfails with:Root Cause
working_diras the initial CWDC:\Users\0\.buzz\REPOS\inferencesaver, PowerShell's FileSystem provider resolves it to the extended-length path format\\?\C:\Users\...cmd.exe(spawned by npm/npx) does not support\\?UNC paths as a CWD and falls back toC:\WindowsC:\Program Files\Git\bin\bash.exe --login) spawned from this terminal inherits the\\?CWD environmentWorkaround
Run
cd C:\Users\0\.buzz\REPOS\inferencesaveronce in the terminal to reset the PowerShell provider path to the normal format. This is not obvious and wastes time every time a new terminal is opened.Affected Environment
Suggested Fix
When spawning the terminal, Berd should normalize the
working_dirpath to its non-extended-length form (C:\...instead of\\?\C:\...) before passing it to PowerShell. This could be done by:\\?prefix when spawning the shell processcdto the non-extended path in the initial commandImpact
This is a significant UX issue for any Windows user of Berd who works with Node.js projects, Python projects, or any toolchain that spawns
cmd.exesubprocesses. It makes the terminal unusable out of the box for running dev servers, builds, and package managers.