You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
install.ps1: a shim gh's child that keeps the output pipe can outlive the 10-second deadline #558
install.ps1's Invoke-GhApi (#550) gives gh 10 seconds to exit and 2 more for its output to complete, then runs taskkill /T /F on the launched process. When gh is a .cmd/.bat shim run through cmd.exe, the shim can start a child that inherits the stdout pipe and then exit: WaitForExit succeeds, $said.Wait(2000) times out, and taskkill targets the launcher that has already exited, so the child can live on. On Windows PowerShell's .NET Framework, Process.Dispose() also leaves the StandardOutput/StandardError readers open, so an outstanding read keeps the pipe handles and a worker.
The official gh.exe is not a shim, so this does not affect a normal install; it affects shim installs and the test stand-in.
Where
install.ps1, Invoke-GhApi: the timeout branch and the finally.
Possible fix
Contain descendants from launch (a Windows job object, which in PowerShell 5.1 means P/Invoke) and close both readers explicitly in finally (guarding the close against a pending ReadToEndAsync). Add an extracted-helper test where the launcher exits while a child retains the output.
Two Low notes on install.sh's gh watcher from the same review: its current sleep 1 is briefly orphaned after a quick call (it expires within a second), and the watcher identifies gh by PID only, so a PID reused within its one-second look could be signalled; a single supervisor that owns the child would remove both.
Found by
Codex gpt-6.1-sol delta review of #550 at 73afcb8 (Medium). Left for a follow-up at merge time.
Activity
feat(install): offer to give the GitHub star through a signed-in gh (#…
fix(install): end a gh shim's lingering child with the Windows star c…