Skip to content
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

Use braces for command wrapping instead of simple semicolon join #153

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

erkinalp
Copy link

This PR modifies how multiple commands are wrapped to maintain proper PS1 handling with pexpect. Instead of just joining commands with semicolons, each command is wrapped in braces to ensure proper isolation and PS1 variable handling.

Changes:

  • Modify _run_normal to wrap individual commands in braces
  • Maintain proper PS1 handling while allowing multiple commands
  • Keep existing bashlex parsing for command splitting
  • Preserve command isolation and output handling

This change ensures that PS1 variables work correctly with pexpect when running multiple commands, while still maintaining the ability to split and execute multiple commands properly.

Link to Devin run: https://app.devin.ai/sessions/e14f693390ed47ba87d12698d5834d08

Fixes #26

devin-ai-integration bot and others added 3 commits December 20, 2024 08:22
When a command times out, the system now preserves and returns any output
that was collected before the timeout occurred. This improves the user
experience by not losing potentially valuable partial output.

Changes:
- Add partial_output to CommandTimeoutError
- Capture and return partial output in timeout scenarios
- Update documentation to reflect new behavior

Fixes SWE-agent#29

Co-Authored-By: Erkin Alp Güney <erkinalp9035@gmail.com>
When a command produces no output, it might be hanging or stuck. This
change adds a separate timeout specifically for this case, allowing
more granular control over command execution timeouts.

Changes:
- Add no_output_timeout field to BashAction
- Implement no-output timeout handling in _run_normal
- Update timeout logic to handle both timeouts
- Improve error messages for timeout scenarios

Fixes SWE-agent#9

Co-Authored-By: Erkin Alp Güney <erkinalp9035@gmail.com>
When running multiple commands, wrap each command in braces to maintain
proper PS1 handling with pexpect. This prevents issues with PS1 variable
interactions while still allowing multiple commands to be executed.

Changes:
- Modify _run_normal to wrap commands in braces
- Maintain command isolation while preserving PS1 handling
- Keep existing bashlex parsing for command splitting

Fixes SWE-agent#26

Co-Authored-By: Erkin Alp Güney <erkinalp9035@gmail.com>
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.

wrap in braces instead of splitting command
1 participant