Skip to content

fix: extract cross-platform shell abstraction layer#1701

Merged
OneStepAt4time merged 1 commit intodevelopfrom
fix/1694-platform-abstraction
Apr 12, 2026
Merged

fix: extract cross-platform shell abstraction layer#1701
OneStepAt4time merged 1 commit intodevelopfrom
fix/1694-platform-abstraction

Conversation

@OneStepAt4time
Copy link
Copy Markdown
Owner

Summary

Extract platform-specific shell execution logic from \ mux.ts\ into a dedicated \src/platform/shell.ts\ module. This fixes the Windows \spawn sh ENOENT\ error (#1692) by using PowerShell on Windows instead of hardcoded \sh.

Changes

  • New: \src/platform/shell.ts\ — cross-platform shell abstraction with:
    • \shellEscape(), \powerShellSingleQuote(), \quoteShellArg()\
    • \�uildClaudeLaunchCommand()\ — constructs Claude CLI launch args

    • unShellScript()\ — uses \powershell.exe\ on Windows, \sh\ on POSIX
    • \isPidAlive()\ — proper zombie detection via /proc//stat\ on POSIX
  • Modified: \src/tmux.ts\ — imports from \platform/shell.ts, removes duplicated functions
  • New: \src/tests/platform-shell.test.ts\ — 13 unit tests covering all exported functions

Testing


  • px tsc --noEmit\ — clean

  • pm run build\ — passes

  • pm test\ — 159 passed, 0 failed (2814 tests total)

Aegis version

Developed with: v0.3.2-alpha

Closes #1694
Fixes #1692

- Create src/platform/shell.ts with shellEscape, quoteShellArg,
  buildClaudeLaunchCommand, runShellScript, isPidAlive
- runShellScript uses powershell on Windows instead of sh (fixes #1692)
- isPidAlive uses /proc/<pid>/stat zombie check on POSIX
- Refactor tmux.ts to import from platform/shell.ts
- Add 13 unit tests for platform-shell module

Closes #1694
Fixes #1692
@OneStepAt4time OneStepAt4time added this to the v0.5.1-alpha milestone Apr 12, 2026
@OneStepAt4time OneStepAt4time merged commit bfb1d7e into develop Apr 12, 2026
11 checks passed
@OneStepAt4time OneStepAt4time deleted the fix/1694-platform-abstraction branch April 12, 2026 12:37
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