-
Notifications
You must be signed in to change notification settings - Fork 28
fix: preserve newlines in heredoc commands for exec() #140
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Fixes heredoc commands hanging in foreground execution by wrapping commands with newlines instead of placing them on a single line. Heredoc terminators must appear alone on their own line to work correctly. Fixes #139 🤖 Generated with [Claude Code](https://claude.ai/code) Co-authored-by: deathbyknowledge <[email protected]>
🦋 Changeset detectedLatest commit: 6d38e26 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
PR Review: Fix heredoc commands hanging in foreground executionSummaryThis PR fixes a critical bug where heredoc commands would hang when using exec(). The fix properly preserves newlines by wrapping commands in braces across multiple lines instead of placing them on a single line. Code Quality & Best Practices ✅Strengths:
Potential Issues & Considerations1. Background mode consistency 2. Edge case: commands with trailing newlines 3. Commands with leading/trailing whitespace Performance Considerations ✅
Security Concerns ✅
Test Coverage
|
Pull Request ReviewSummaryThis PR fixes a critical bug where heredoc commands would hang during foreground execution (exec). The fix properly preserves newlines by placing heredoc commands on separate lines instead of forcing them onto a single line, which is required for bash to correctly recognize heredoc terminators. Code Quality & Best Practices ✅Strengths:
Code change analysis: // Before (problematic):
script += ` { ${command}; } > >(...)`;
// After (fixed):
script += ` {\n`;
script += `${command}\n`;
script += ` } > >(...)`;This ensures commands with heredocs are properly formatted with the terminator on its own line. Potential Issues & Edge Cases
|
commit: |
🐳 Docker Image PublishedFROM cloudflare/sandbox:0.0.0-pr-140-0cb42aaVersion: You can use this Docker image with the preview package from this PR. |
Fixes the handling of newlines in heredoc commands when using exec().
Fixes heredoc commands hanging in foreground execution by wrapping commands with newlines instead of placing them on a single line. Heredoc terminators must appear alone on their own line to work correctly.
Fixes #139
🤖 Generated with Claude Code