Status: Done (2026-04-03)
Priority: High
Component: lib/wsl/manager.ps1, lib/wsl/manager.Tests.ps1
Parent: SC-016
Depends on: SC-016a
Summary: As a user, I want the main menu to use arrow-key navigation with instant selection so that I no longer need to type a letter and press Enter.
Description:
Replace the current Write-Host menu + Read-Host letter input in Start-InteractiveMode with a Read-SpectreSelection prompt. Pressing Esc exits the menu loop.
- Extract a new
Show-WslMenufunction that callsRead-SpectreSelectionwith menu option labels as choices - Returns the selected command string (e.g., "install", "remove") or
$nullon Esc/cancel - Refactor
Start-InteractiveModeto callShow-WslMenuinstead of theWrite-Hostblock +Read-Host - Remove the
$menuKeyMaphashtable (letter-key mapping no longer needed) - Remove
Clear-Hostper-loop call (Spectre handles terminal rendering) - Remove
Read-Host "Press Enter to continue"pause after command execution - Update
manager.Tests.ps1: mockRead-SpectreSelectioninstead ofRead-Host, test Esc returns$nulland exits loop, test valid selection dispatches correct command
Acceptance Criteria:
- Main menu uses
Read-SpectreSelectionwith arrow-key navigation - Menu options respond immediately on selection (no Enter + letter required)
- Ctrl+C or selecting "Quit" exits the interactive mode
-
Show-WslMenufunction has Pester unit tests with mockedRead-SpectreSelection - All existing tests continue to pass (updated mocks)