fix: Screen isolation output not captured for quoted commands #26
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes issue #25 where commands with quoted strings (e.g.,
echo "hello") would not show their output when using screen isolation in attached mode.Problem
When running:
The output would only show
[screen is terminating]without the expected "hello" output, even though the command executed successfully with exit code 0.Root Cause
The code used
execSyncwith a constructed shell command string where each argument was wrapped in double quotes. When the command itself contained double quotes, this caused shell parsing errors due to nested quoting:Solution
Use
spawnSyncwith an array of arguments instead ofexecSyncwith a string. Node.js/Bun'sspawnSynchandles argument quoting correctly by passing arguments directly to the process without shell interpretation.Changes
execSyncwithspawnSyncfor screen commandsTest Results
All 25 isolation tests pass, including the 2 new regression tests:
Fixes #25
🤖 Generated with Claude Code