Skip to content

fix(bash): return when the shell exits, not when its pipes close - #35

Merged
rommeld merged 1 commit into
mainfrom
fix/issue-23-bash-background-hang
Sep 26, 2026
Merged

rommeld merged 1 commit into
mainfrom
fix/issue-23-bash-background-hang

Conversation

@rommeld

@rommeld rommeld commented Sep 26, 2026

Copy link
Copy Markdown
Owner

A background process (sleep 40 &, server &) inherits stdout/stderr, so waiting for pipe EOF blocked the tool until it exited - forever for a server, since bash has no default timeout. Mirror pi's waitForChildProcess: after the shell exits, keep reading until the pipes close or stay quiet for 100 ms (re-armed by every chunk), then stop reading and close our pipe ends.

Fixes #23

A background process (`sleep 40 &`, `server &`) inherits stdout/stderr,
so waiting for pipe EOF blocked the tool until it exited - forever for a
server, since bash has no default timeout. Mirror pi's
waitForChildProcess: after the shell exits, keep reading until the pipes
close or stay quiet for 100 ms (re-armed by every chunk), then stop
reading and close our pipe ends.

Fixes #23

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@rommeld rommeld self-assigned this Sep 26, 2026
@rommeld
rommeld merged commit eba17f6 into main Sep 26, 2026
2 checks passed
@rommeld
rommeld deleted the fix/issue-23-bash-background-hang branch September 26, 2026 14:10
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.

bash tool hangs until backgrounded processes exit

1 participant