Skip to content

fix(aliases): route shutdown helpers safely on WSL - #515

Merged
primetimetank21 merged 1 commit into
developfrom
fix/514-wsl-shutdown-helpers
Sep 26, 2026
Merged

primetimetank21 merged 1 commit into
developfrom
fix/514-wsl-shutdown-helpers

Conversation

@primetimetank21

@primetimetank21 primetimetank21 commented Sep 26, 2026 •

Copy link
Copy Markdown
Owner

Summary

Make the Bash/Zsh shutdown helpers target the Windows host inside WSL while preserving ordinary native Linux/macOS command arguments. Detect WSL from Linux kernel evidence, not environment variables or executable presence alone. Conflicting/failed detection returns an error without an operation; Windows interop failures never fall back to native shutdown.

Changes

  • Add one private platform selector and update sdn, tsdn, and cancel_tsdn.
  • Require exactly one canonical positive minute argument, bound WSL delays before conversion, and preserve native minute strings.
  • Preserve actual cancellation diagnostics/status and warn about Windows positive-timeout forced application closure/unsaved-data loss.
  • Add a fully isolated, non-forwarding stub harness plus Linux/macOS Bash/Zsh CI and lint wiring.
  • Document native behavior, ambiguity rejection, interop requirements, and custom-kernel/container detection limits.

Test plan

  • Independent static review: no findings; reviewed harness cleared before its first behavior execution.
  • New isolated suite: 3,400 assertions passed, 0 failed, across local Bash and Zsh 5.8.1.
  • Existing alias unit tests: 6 passed; alias parity passed.
  • Bash/Zsh syntax, ShellCheck 0.8.0, and git diff --check passed.
  • All 10 hosted checks passed at head 3334fc32d6eed2e5c72147ce1bc348794b959e5a: Validate Setup Script (6/6), E2E Install Smoke Test (4/4).
  • New syntax/helper steps ran successfully on Linux and native macOS: 3,400 assertions passed on each, using Bash and Zsh. macOS logs confirm system Bash 3.2.57 and Zsh 5.9. New harness ShellCheck step passed.

Local Zsh and ShellCheck were unpacked into ignored tooling storage, not installed globally. A local Zsh adapter supplies its unpacked module path; hosted CI uses the OS-installed shells directly.

The harness extracts the actual helper definitions unchanged, clears inherited inputs, uses a fixture-only PATH and recording stubs, and never forwards sudo arguments. Missing-executable tests cannot resolve a real Windows shutdown executable. No real shutdown or cancellation command was executed. Tests simulate WSL/OS behavior rather than proving live power-control semantics. The existing live alias override and home symlink are unchanged.

Related

Closes #514

Hygiene and approval boundary

  • New/changed lines are ASCII-only; pre-existing workflow emoji are unchanged.
  • Conventional Commit with exactly one mandatory Copilot co-author trailer.
  • Branch forked from the latest develop at 6fb62d7; PR targets develop.
  • No PowerShell profiles, installers, startup files, tool versions, or unrelated aliases changed.

Implementation is authorized through a reviewed, CI-validated PR only. Do not merge or replace live aliases without separate user approval. No maintainer/GitHub approval is implied by the independent local source review.

Preserve native Linux/macOS commands, reject ambiguous platform signals, and validate Windows delays before conversion. Add isolated Bash/Zsh regression coverage and CI wiring without executing real power-control commands.

Closes #514

Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
@primetimetank21
primetimetank21 marked this pull request as ready for review September 26, 2026 00:09
@primetimetank21
primetimetank21 merged commit feae7d6 into develop Sep 26, 2026
10 checks passed
@primetimetank21
primetimetank21 deleted the fix/514-wsl-shutdown-helpers branch September 26, 2026 00:28
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.

Make shutdown helpers WSL-aware with native Linux safeguards

1 participant