Skip to content

Windows port carry-over: main/preload/scripts/patches/distribution/CI#2

Merged
ElecTream merged 1 commit into
mainfrom
windows-support
May 9, 2026
Merged

Windows port carry-over: main/preload/scripts/patches/distribution/CI#2
ElecTream merged 1 commit into
mainfrom
windows-support

Conversation

@ElecTream
Copy link
Copy Markdown
Owner

Lands all the Windows-port work that was sitting in the working tree from the prior session. Required for npm install to succeed on a fresh clone: the postinstall script (referenced in package.json) lives here, as do the patches it applies and the scripts/dev.js wrapper that the dev script calls.

scripts/

  • postinstall.js: cross-platform dispatcher. On any OS: applies patches via patch-package, then runs electron-builder install-app-deps. On macOS: also patches the dev icon. On Windows: no-ops past the rebuild.
  • dev.js: replaces unset ELECTRON_RUN_AS_NODE && electron-vite dev (POSIX-only). Node wrapper that does delete process.env.ELECTRON_RUN_AS_NODE then exec's electron-vite. Works on Windows + macOS without cross-env's empty-string semantics issue.
  • doctor.js, doctor.ps1: diagnostic tooling for both platforms.
  • setup.ps1: PowerShell mirror of commands/setup.command for first-launch.
  • build-icons.js: regenerates resources/icon.ico from PNGs via png-to-ico.

patches/

  • node-gyp+11.5.0.patch: teaches node-gyp 11.5 about VS 2026 (Build Tools 18.5). Adds versionMajor=18 → versionYear=2026 mapping; expands [2019, 2022] arrays to [2019, 2022, 2026]; maps versionYear 2026 → toolset v145.
  • node-pty+1.1.0.patch: removes Spectre-mitigated lib requirement + fixes winpty.gyp to call .\GetCommitHash.bat / .\UpdateGenVersion.bat (Windows security setting NoDefaultCurrentDirectoryInExePath=1 breaks the bare cmd /c "cd shared && GetCommitHash.bat" pattern).

src/main/

  • platform/win-process.ts: NEW. Centralized Windows helpers for binary discovery (probes %APPDATA%\npm, %LOCALAPPDATA%\npm, %LOCALAPPDATA%\Programs\claude, Volta, then where claude), PATH enrichment, cmd.exe wrapping for .cmd/.bat files, and taskkill /T /F for full subprocess-tree cleanup.
  • cli-env.ts, process-manager.ts, claude/run-manager.ts, claude/pty-run-manager.ts: branch on win32 to use win-process helpers.
  • index.ts: Windows-specific BrowserWindow flags (thickFrame:false, paintWhenInitiallyHidden:false), Ctrl+Alt+C summon hotkey on Windows (Alt+Space collides with Windows system menu), region screenshot via desktopCapturer + ms-screenclip URI, JumpList delight item, gridWindow snap-grid for multi-monitor positioning, multi-tab Ctrl+Alt+1..9 global hotkeys, tray.ico variant on Windows.
  • skills/installer.ts: replaced curl|tar shell pipeline (Windows bsdtar doesn't accept the glob arg form) with Node-native fetch + the tar npm package. Cross-platform; no shell.

src/preload/index.ts

  • New exports: takeScreenshot now takes optional 'region' | 'fullscreen' mode; activate-tab-by-index event for global Ctrl+Alt+1..9 hotkeys.

src/renderer/

  • ConversationView, SearchPanel, StatusBar: minor Windows-aware tweaks (CMD label, screenshot mode plumbing, terminal-launcher discovery).

src/shared/types.ts

  • Channel constants for new IPC: START_WINDOW_DRAG, ACTIVATE_TAB_BY_INDEX, TAKE_SCREENSHOT mode. New TerminalInstallation/PreferredTerminalId types.

resources/

  • icon.ico, tray.ico: multi-res Windows icons (16/24/32/48/64/128/256) generated from existing PNG assets via png-to-ico.

distribution/

  • winget manifest (Clui.installer.yaml + .locale.en-US.yaml + .yaml): scaffolded for winget install ElecTream.Clui once first release is tagged.
  • scoop bucket entry (clui.json): for users who prefer scoop.
  • README.md: distribution channel overview.

.github/workflows/

  • release.yml: now matrix-builds macOS arm64 + macOS x64 + windows-latest. windows-latest ships VS 2022 Build Tools preinstalled so node-pty rebuilds cleanly. --publish always uploads all artifacts to the same GitHub Release tag.
  • ci.yml: NEW. Non-tag PR CI — both OSes, build only, no publish.

docs/

  • WINDOWS.md: parity matrix, node-pty troubleshooting, SmartScreen workaround, hotkey rebinding, tray pinning. Living doc.
  • BUBBLE_RESEARCH.md, MOBILE.md: prior-session research artifacts on potential Android bubble interface for remote Claude sessions.

README.md

  • Added Windows fork callout linking to upstream + install/dev sections for both platforms.

Lands all the Windows-port work that was sitting in the working tree from
the prior session. Required for `npm install` to succeed on a fresh clone:
the postinstall script (referenced in package.json) lives here, as do the
patches it applies and the scripts/dev.js wrapper that the dev script calls.

scripts/
- postinstall.js: cross-platform dispatcher. On any OS: applies patches via
  patch-package, then runs `electron-builder install-app-deps`. On macOS:
  also patches the dev icon. On Windows: no-ops past the rebuild.
- dev.js: replaces `unset ELECTRON_RUN_AS_NODE && electron-vite dev`
  (POSIX-only). Node wrapper that does `delete process.env.ELECTRON_RUN_AS_NODE`
  then exec's electron-vite. Works on Windows + macOS without cross-env's
  empty-string semantics issue.
- doctor.js, doctor.ps1: diagnostic tooling for both platforms.
- setup.ps1: PowerShell mirror of commands/setup.command for first-launch.
- build-icons.js: regenerates resources/icon.ico from PNGs via png-to-ico.

patches/
- node-gyp+11.5.0.patch: teaches node-gyp 11.5 about VS 2026 (Build
  Tools 18.5). Adds versionMajor=18 → versionYear=2026 mapping;
  expands [2019, 2022] arrays to [2019, 2022, 2026]; maps versionYear
  2026 → toolset v145.
- node-pty+1.1.0.patch: removes Spectre-mitigated lib requirement +
  fixes winpty.gyp to call .\GetCommitHash.bat / .\UpdateGenVersion.bat
  (Windows security setting NoDefaultCurrentDirectoryInExePath=1 breaks
  the bare `cmd /c "cd shared && GetCommitHash.bat"` pattern).

src/main/
- platform/win-process.ts: NEW. Centralized Windows helpers for binary
  discovery (probes %APPDATA%\npm, %LOCALAPPDATA%\npm,
  %LOCALAPPDATA%\Programs\claude, Volta, then `where claude`),
  PATH enrichment, cmd.exe wrapping for .cmd/.bat files, and
  taskkill /T /F for full subprocess-tree cleanup.
- cli-env.ts, process-manager.ts, claude/run-manager.ts,
  claude/pty-run-manager.ts: branch on win32 to use win-process helpers.
- index.ts: Windows-specific BrowserWindow flags (thickFrame:false,
  paintWhenInitiallyHidden:false), Ctrl+Alt+C summon hotkey on Windows
  (Alt+Space collides with Windows system menu), region screenshot via
  desktopCapturer + ms-screenclip URI, JumpList delight item, gridWindow
  snap-grid for multi-monitor positioning, multi-tab Ctrl+Alt+1..9
  global hotkeys, tray.ico variant on Windows.
- skills/installer.ts: replaced curl|tar shell pipeline (Windows bsdtar
  doesn't accept the glob arg form) with Node-native fetch + the `tar`
  npm package. Cross-platform; no shell.

src/preload/index.ts
- New exports: takeScreenshot now takes optional 'region' | 'fullscreen'
  mode; activate-tab-by-index event for global Ctrl+Alt+1..9 hotkeys.

src/renderer/
- ConversationView, SearchPanel, StatusBar: minor Windows-aware tweaks
  (CMD label, screenshot mode plumbing, terminal-launcher discovery).

src/shared/types.ts
- Channel constants for new IPC: START_WINDOW_DRAG, ACTIVATE_TAB_BY_INDEX,
  TAKE_SCREENSHOT mode. New TerminalInstallation/PreferredTerminalId types.

resources/
- icon.ico, tray.ico: multi-res Windows icons (16/24/32/48/64/128/256)
  generated from existing PNG assets via png-to-ico.

distribution/
- winget manifest (Clui.installer.yaml + .locale.en-US.yaml + .yaml):
  scaffolded for `winget install ElecTream.Clui` once first release is tagged.
- scoop bucket entry (clui.json): for users who prefer scoop.
- README.md: distribution channel overview.

.github/workflows/
- release.yml: now matrix-builds macOS arm64 + macOS x64 + windows-latest.
  windows-latest ships VS 2022 Build Tools preinstalled so node-pty
  rebuilds cleanly. --publish always uploads all artifacts to the same
  GitHub Release tag.
- ci.yml: NEW. Non-tag PR CI — both OSes, build only, no publish.

docs/
- WINDOWS.md: parity matrix, node-pty troubleshooting, SmartScreen
  workaround, hotkey rebinding, tray pinning. Living doc.
- BUBBLE_RESEARCH.md, MOBILE.md: prior-session research artifacts on
  potential Android bubble interface for remote Claude sessions.

README.md
- Added Windows fork callout linking to upstream + install/dev sections
  for both platforms.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@ElecTream ElecTream merged commit 967e1f1 into main May 9, 2026
5 of 6 checks passed
@ElecTream ElecTream deleted the windows-support branch May 9, 2026 07:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant