feat: Windows support #39
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Adds Windows support to surf-cli. All core features tested and working on Windows 11 ARM64 with Chromium (scoop), Node 24, and ImageMagick 7.
Changes
Socket communication (
host.cjs,cli.cjs,do-executor.cjs,mcp-server.cjs)//./pipe/surf) instead of Unix domain sockets (/tmp/surf.sock) whenprocess.platform === "win32"fs.unlinkSync(SOCKET_PATH)on Windows (named pipes don't need cleanup)fs.chmodSync(SOCKET_PATH, 0o600)on Windows (not applicable to named pipes)Temp file paths (
host.cjs,cli.cjs)%LOCALAPPDATA%/Temp/surf/instead of/tmp/on Windowspi-auto-*), snap screenshots (surf-snap-*), error screenshots (surf-error-*)ImageMagick resize (
host.cjs,cli.cjs)cmd.exefrom interpreting>as a file redirectmagick "file.png" -resize 1200x1200\> "file.png"→ cmd eats the>, corrupts the filemagick "file.png" -resize "1200x1200>" "file.png"→ works correctlyNetwork store (
network-store.cjs)%LOCALAPPDATA%/Temp/surf/on Windows instead of/tmp/surfTesting
Tested end-to-end on Windows 11 ARM64 with Chromium 144 (scoop), Node 24, ImageMagick 7.1:
tab.list/tab.new/tab.switchgo(navigate) /back/forwardread/read --compact/page.textclick <ref>/type <text>/keysnap(screenshot + ImageMagick resize)snap --full/snap --outputscroll/scroll.infojs <code>search/locate.rolewindow.new/window.list/window.close--window-idisolationcookie.listperf.metricsNotes
install-native-host.cjs) already had Windows support via registry entries; no changes needed thereconvert(IM6) →magick(IM7) fallback chain preserved, just the geometry quoting changes on Windows