mirror of
https://github.com/stablyai/orca.git
synced 2026-10-30 16:47:34 +00:00
3.4 KiB
3.4 KiB
Cross-Platform Support
Orca targets macOS, Linux, and Windows. Keep all platform-dependent behavior behind runtime checks:
- Keyboard shortcuts: Never hardcode
e.metaKey. Use a platform check (navigator.userAgent.includes('Mac')) to pickmetaKeyon Mac andctrlKeyon Linux/Windows. Electron menu accelerators should useCmdOrCtrl. - Shortcut labels in UI: Display
⌘/⇧on Mac andCtrl+/Shift+on other platforms. - File paths: Use
path.joinor Electron/Node path utilities — never assume/or\. - Windows terminal shells:
--shellpicks the shell a terminal is;--commandis typed into whatever shell the host spawned, so a shell choice routed throughcommandsilently becomes a child process. - Windows setup scripts: the setup/issue-command runner is a
.cmdbatch file unless the script starts with a#!line — never derive that from the user's terminal-shell preference, and never launch a.cmdrunner with a barecmd.exe /cfrom a Git Bash pane (MSYS rewrites the/c). - Windows child processes: start them through
runProcess/spawnProcessfrom@orca/process-host— neverchild_processdirectly. It pinswindowsHide, refusesshell: true, and encodes.cmd/.batarguments so neitherCommandLineToArgvWnorcmd.exemangles them. Recognised npm/pnpm.cmdshims are resolved to their real target so the spawn skipscmd.exeentirely. - Ripgrep: Orca bundles
rgfor every platform, WSL, and SSH remotes. Spawn it throughspawnBundledRipgrep(main) orresolveRelayRipgrepCommand(relay), never a bare'rg'— Windows resolves a bare name in the spawn cwd before PATH. Don't add git/readdir fallbacks locally; the relay's chain exists only for hosts an upload never reached. - Windows process enumeration: read the table through
src/main/windows/windows-process-table.ts, never by forkingpowershell.exe. - Windows MSYS/Git Bash panes: their children break away from the per-PTY job unless it is created without
JOB_OBJECT_LIMIT_BREAKAWAY_OK, and aconpty.nodebuilt before that fix passes every existing gate. - Windows daemon-host relocation: the terminal daemon runs from a copy of the app runtime under
%LOCALAPPDATA%, which is what survives an auto-update. - macOS daemon launch: packaged macOS runs the terminal daemon from a copy of the signed terminal host helper through launchd, so an update cannot sever its privacy grants. Before touching that copy, its cleanup, or the fork fallback, read
macos-daemon-tcc-attribution.md. - Windows EDR signal: don't add
-ExecutionPolicy Bypass,-EncodedCommand,cmd.exe /cwith escaped free text, per-operation interpreter spawning, or runtimeAdd-Typecompilation without reviewing the EDR impact first — behavioural EDR scores each of those, and being signed does not clear them. - WSL commands: build argv with
buildWslExecArgs(always--exec— under--,wsl.exeexpands$namein every argument and silently rewrites the script), and fence anything whose stdout you parse withbuildWslCapturedLoginShellCommand, because the interactive login shell prints the distro banner to stdout. - Linux native modules: keep the glibc floor at Ubuntu 20.04 / glibc 2.31. A module compiled from source on a newer runner can reference symbol versions absent on the floor and crash the app on startup. Packaging fails if a bundled native binary needs newer glibc.