OpenHands
OpenHands copied to clipboard
Add support for interactive command input
This PR adds support for interactive command input in the bash execution system.
Changes
- Add
input_text
field toCmdRunAction
for sending input to interactive processes - Enhance bash execution to handle interactive input with clear prompts
- Update function description to clearly explain interactive command usage
- Add test case for interactive command handling
Example Usage
# First command - starts interactive process
action = CmdRunAction(
command="./script.sh",
blocking=False
)
result = session.run(action)
# If waiting for input (exit_code == -1)
if result.exit_code == -1:
# Send input
action = CmdRunAction(
command="", # Empty command to continue
input_text="user input here"
)
result = session.run(action)