Skip to content

Commit

Permalink
Added INTERPRETER_SIMPLE_BASH option
Browse files Browse the repository at this point in the history
  • Loading branch information
KillianLucas committed Nov 22, 2024
1 parent a045361 commit e01a33a
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions interpreter_1/tools/simple_bash.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,22 @@ async def __call__(
raise ToolError("no command provided")

try:
# Create process with shell=True to handle all bash features properly
# Set up non-interactive environment
env = os.environ.copy()
env.update(
{
"DEBIAN_FRONTEND": "noninteractive", # Prevents apt from prompting
"NONINTERACTIVE": "1", # Generic non-interactive flag
}
)

# Create process with shell=True and stdin set to DEVNULL
process = await asyncio.create_subprocess_shell(
command, stdout=asyncio.subprocess.PIPE, stderr=asyncio.subprocess.PIPE
command,
stdout=asyncio.subprocess.PIPE,
stderr=asyncio.subprocess.PIPE,
stdin=asyncio.subprocess.DEVNULL, # Explicitly disable stdin
env=env,
)

try:
Expand Down

0 comments on commit e01a33a

Please sign in to comment.