-
Notifications
You must be signed in to change notification settings - Fork 47
FEATURE: optmize bash execution by pty #104
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
…t of dependency on global locks.
|
@codex review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4b20500ddb
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| cleanCmd := strings.ReplaceAll(command, "\n", " ; ") | ||
|
|
||
| // send command + marker, preserving the user's last exit code | ||
| // use a subshell at the end to restore $? to the original exit code | ||
| cmdText := fmt.Sprintf("%s\n__c=$?\nprintf \"%s${__c}%s\\n\"\n(exit ${__c})\n", cleanCmd, exitCodePrefix, exitCodeSuffix) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Preserve newline semantics in bash commands
Before executing a bash command, run replaces every newline with ;. This changes shell semantics and breaks newline-sensitive constructs such as here-docs (cat <<'EOF' ... EOF) or multi-line case/read blocks, which now become syntax errors. Since the API accepts multi-line code strings, this is a regression for valid bash scripts. Consider sending the original string (or another framing mechanism that preserves newlines) instead of flattening them.
Useful? React with 👍 / 👎.
Summary
Testing
Breaking Changes
Checklist