From 3d3b3cfba4e23dd1b7a21ec4a38190b41a80c67d Mon Sep 17 00:00:00 2001 From: AI Christianson Date: Wed, 12 Feb 2025 18:04:27 -0500 Subject: [PATCH] set env vars to disable common interactive modes --- ra_aid/proc/interactive.py | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/ra_aid/proc/interactive.py b/ra_aid/proc/interactive.py index 79d1135..4d9f8b2 100644 --- a/ra_aid/proc/interactive.py +++ b/ra_aid/proc/interactive.py @@ -69,13 +69,30 @@ def run_interactive_command(cmd: List[str]) -> Tuple[bytes, int]: except (AttributeError, io.UnsupportedOperation): stdin_fd = None + # Set up environment variables for the subprocess + env = os.environ.copy() + env.update({ + 'DEBIAN_FRONTEND': 'noninteractive', + 'GIT_PAGER': '', + 'PYTHONUNBUFFERED': '1', + 'CI': 'true', + 'LANG': 'C.UTF-8', + 'LC_ALL': 'C.UTF-8', + 'COLUMNS': '120', + 'FORCE_COLOR': '1', + 'GIT_TERMINAL_PROMPT': '0', + 'PYTHONDONTWRITEBYTECODE': '1', + 'NODE_OPTIONS': '--unhandled-rejections=strict' + }) + proc = subprocess.Popen( cmd, stdin=slave_fd, stdout=slave_fd, stderr=slave_fd, bufsize=0, - close_fds=True + close_fds=True, + env=env ) os.close(slave_fd) # Close slave end in the parent process.