Skip to content

Commit e01a33a

Browse files
committed
Added INTERPRETER_SIMPLE_BASH option
1 parent a045361 commit e01a33a

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

interpreter_1/tools/simple_bash.py

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,22 @@ async def __call__(
2222
raise ToolError("no command provided")
2323

2424
try:
25-
# Create process with shell=True to handle all bash features properly
25+
# Set up non-interactive environment
26+
env = os.environ.copy()
27+
env.update(
28+
{
29+
"DEBIAN_FRONTEND": "noninteractive", # Prevents apt from prompting
30+
"NONINTERACTIVE": "1", # Generic non-interactive flag
31+
}
32+
)
33+
34+
# Create process with shell=True and stdin set to DEVNULL
2635
process = await asyncio.create_subprocess_shell(
27-
command, stdout=asyncio.subprocess.PIPE, stderr=asyncio.subprocess.PIPE
36+
command,
37+
stdout=asyncio.subprocess.PIPE,
38+
stderr=asyncio.subprocess.PIPE,
39+
stdin=asyncio.subprocess.DEVNULL, # Explicitly disable stdin
40+
env=env,
2841
)
2942

3043
try:

0 commit comments

Comments
 (0)