Repository navigation
feat(desktop): Windows support - #9975
Open
waleedlatif1 wants to merge 44 commits into
Open
waleedlatif1 wants to merge 44 commits into
waleedlatif1 wants to merge 44 commits into
Conversation
Adds a Windows x64 build of the desktop app alongside macOS. - Shell: single-instance focus, AppUserModelID per channel, a Windows File/Edit/View/Help menu, auto-hidden menu bar, native caption that follows Sim's theme, a full-colour tray that keeps the app resident. - Terminal: PowerShell 7, Windows PowerShell 5.1 and Git Bash through the bundled ConPTY with OSC 633 shell integration; Stop targets only the stopped command's process tree; the update-restart check counts a busy Windows terminal. - Native file tools: a Node-fs backend behind the same seam as the POSIX addon, with lexical path validation, canonical-path and identity checks. - One per-platform feature table gates computer use, Help search, terminal themes, browser import and password copy; IPC channel specs declare their feature. - Packaging and updates: NSIS per-user installer, per-channel install folder and icons, NSIS updater flow, latest.yml feed and a platform-aware download route; Windows release job signed with Azure Artifact Signing, never published unsigned, never blocking macOS. - The web app reads the bridge's platform and sends it, with each terminal's shell, to Mothership.
The preload exposes continue-sign-in, bring-sign-in-back, cancel-sign-in and pending-sign-in only under features.browserImport, but main registered them everywhere. Gate them on browserImport, and teach check:desktop-ipc to fail whenever a channel's platformFeature disagrees with the preload's feature spread, so the two sides cannot drift again.
…mpt cases The Windows install test queued a dialog response the no-prompt-without-work path never consumes, leaving it for whichever test asks next. Replace it with the three cases that reach quitAndInstall(true, true): nothing running, running work confirmed, and a mandatory install, and drop the same stale response from the failed-installer test.
The resource menus and the terminal paste toast hard-coded Command glyphs. Add formatShortcut beside isMacPlatform and use it for Find, zoom, Clear, New Tab, Close Terminal and paste, which the Windows shell binds to the same keys with Control.
The native toolbar menu offered Import Passwords on every platform, but the import bridge ships only where desktopFeatures enables browserImport.
List the sign-in hand-off and password copy among what Windows withholds, describe which processes Stop ends without process groups, and say when an update restart asks before installing.
Chrome binds Ctrl+Tab and Ctrl+Shift+Tab to tab switching on every platform, macOS included, ahead of the page. Resolve them in browserShortcutForInput so a page that handles Tab no longer swallows the chord; agent keystrokes still cannot trigger it.
… mock The hand-rolled window stub grew one method per Windows failure: bringing the window forward on win32 also pins and unpins it on top, which the stub lacked. The shared BrowserWindow mock already carries every window method, so the test overrides only the page URL and redeem result, and runs on both darwin and win32.
The shell-integration parser returned a chunk's text and markers apart, and the session applied every marker before any text. When one chunk carried a command's start marker, its output, and its finish marker together, the finish marker resolved the run first and the output that came before it was then dropped, so the agent saw a completed command with exit 0 and no output. Under load node-pty on Windows coalesces Git Bash's separate writes into one read, which is how 'sim-ok-10' went missing. The parser now returns the stream as ordered segments and the session applies text and markers in the order the shell wrote them, which also stops the echoed command line before the start marker leaking into the captured output.
…service tests The sign-out test polled for the sleep blocker with vi.waitFor's 1 s deadline, but the path there is three sequential atomic writes to userData (install id, then the journal's claiming and claimed records). On Windows Defender scans each new file, measured at up to ~220 ms for a single write on an idle box, so under the parallel suite the deadline lapsed with the call not yet held. The tests now await the registration request and the busy change themselves, bounded only by the test timeout.
Nothing imports it; callers read it through the parse return type.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
[High impact] The PR appears safe to merge, with one non-blocking Windows theme mismatch. Findings
SummaryAdds Windows desktop support while keeping platform-specific features behind a shared feature table.
|
…rlier native program's code
…eep a failed ps probe unknown Only the shell and the real shell behind a launcher (its first child, created before the startup marker) are walked, so a worker an earlier background job starts mid-command is never taken for the command's and force-killed. On POSIX an empty ps result reads as idle only once the shell pid is confirmed gone.
…out clearing it Clearing $LASTEXITCODE as a line was accepted hid it from that line itself. The code now counts as the line's when it changed, or when it is unchanged and the line added no error record.
Collaborator
Author
…t Windows caption
…p preference only A forced page theme (/login, /chat) or the landing pages' own storage key flipped nativeTheme.themeSource for every window, flashing the workspace window light. Report only the app's sim-theme preference again and drop the theme-provider script attributes that carried the per-page values.
…r's prompt commands out of preexec
…up before Ctrl-C and escalate only against it
…follows them realpath follows every symlink in a path, so a link planted in a repository that targets \\host\share made Windows send the user's NTLM hash before the consent dialog. localRealpath walks the path with lstat first and refuses a link to a network path, and refuses a path that resolves to a share (a mapped drive), which the native backend could never open. Authorization, the VFS grant and URI paths, and the Windows backend all resolve through it. Covers the Windows backend's in-grant junction, post-open canonical and root checks with tests, and states the remaining pathname-open race precisely.
… compare import revisions as bigints Also describes the credential vault's Windows protection accurately (DPAPI plus the profile ACL, not file modes).
…s release ships The Windows download links and install steps 404 until Authenticode signing exists and a signed release is published. Restores the macOS-only wording in the desktop and self-hosting docs and the sim-setup README; the developer notes in apps/desktop/README.md stay.
A deployment older than Windows support ignores ?platform=windows and redirects to the macOS DMG, which the CLI reported as success. The resolved name must now carry the platform's installer extension.
…ws CI jobs actually guarantee forceCodeSigning in electron-builder 26 fails only when no signing configuration exists, DLLs are not Authenticode-signed by signExts, and the prerelease publish waits for the Windows build to finish even though a Windows failure does not block it.
…name Windows commands in their own shell's syntax before a restart, and tidy session docs
…studioai/sim into feat/desktop-windows-v2
…ath, as the rest of the shell does
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 (x64, NSIS) support to the desktop app. macOS behaviour is unchanged. Replaces #9499 with one clean branch rebased on current staging.
Shell
formatShortcut).Terminal on Windows
conpty.dll, with OSC 633 shell integration for each shell.taskkill /T /F.Native file tools on Windows
win32-native-files.ts) sits behind the existingopenNativeFileseam.\\?\and\\.\paths, drive-relative and rooted paths, reserved device names, alternate data streams, and trailing dots or spaces. It closes an SMB/NTLM leak throughrealpaththat could happen before consent.Feature gating
platform.src/shared/platform-features.ts, drives the preload surface, IPC registration (check:desktop-ipcenforces that the two match), executor registration and the background runner.Packaging and updates
.ico. The.nodefiles are signed.NsisUpdaterdrives the ready state and installs silently./api/desktop/update/latest.ymland/api/desktop/update/download?platform=windows. A release without a Windows manifest means "no update", not a 502.desktop.platformandterminals[].shell. That is the companion Mothership PR; this PR includes the synced protocol.CI
build-windowsjob in the new release layout: sharedsourceandpublishjobs, no caches.publisherName, then runs the packaged smoke test. The job is gated on its own signing probe and never blocks the macOS release.package-smoke-windowsleg indesktop-e2e.yml.Behaviour changes on macOS (deliberate)
kill(SIGTERM/SIGKILL) now stops only the running command. node-pty'skill(signal)signalled the shell itself, so on macOS a SIGTERM did nothing (interactive shells ignore it) and a SIGKILL closed the user's tab. It now signals the tty's foreground process group on macOS and Linux, and on Windows it ends the command's process tree. An idle shell is never signalled, and the result reportssignalled.git statusfromvcs_info, which takes the foreground after the command dies, is never signalled.PROMPT_COMMANDparts with newlines, so a user value ending in;(e.g.history -a; $PROMPT_COMMAND) no longer causes a syntax error. The user's ownPROMPT_COMMANDno longer reads as a running command.Known limits on Windows
openat(O_NOFOLLOW).workflow_dispatchwithplatform=windows,sign=true,publish=false.e1a1363204holds those claims back; revert it once a signed Windows release ships.Rollout
No Windows artifacts are published until the Azure signing secrets and variables exist (see the README table). Until then the probe skips the job with a warning, and macOS releases are unaffected.
Test plan
4aa9612784: 91/91 files, 1399 passed, 15 skipped (all POSIX-only).windows-shells.test.ts(pwsh 7, PS 5.1, Git Bash): 17 passed. This covers Stop sparing an earlier background job's workers, a stale$LASTEXITCODE, andkillkeeping the tab.win32-native-filesandlocal-realpath: 23/23.output: "".driver.test.ts,check:desktop-ipc,check:test-patterns, and biome on the changed files.