From 36b80038ca00b66cc79dcba8f7f1c19d7ee8db6f Mon Sep 17 00:00:00 2001 From: AI Christianson Date: Thu, 19 Dec 2024 17:42:40 -0500 Subject: [PATCH] Disable PAGERs for shell commands so agent can work autonomously --- CHANGELOG.md | 1 + ra_aid/proc/interactive.py | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index bedc878..561bef3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Improve ripgrep tool status output. - Added ask_human tool to allow human operator to answer questions asked by the agent. - Handle keyboard interrupt (ctrl-c.) +- Disable PAGERs for shell commands so agent can work autonomously. ## [0.6.4] - 2024-12-19 diff --git a/ra_aid/proc/interactive.py b/ra_aid/proc/interactive.py index eab81e5..365d130 100644 --- a/ra_aid/proc/interactive.py +++ b/ra_aid/proc/interactive.py @@ -52,6 +52,10 @@ def run_interactive_command(cmd: List[str]) -> Tuple[bytes, int]: os.remove(path) try: + # Disable pagers by setting environment variables + os.environ['GIT_PAGER'] = '' + os.environ['PAGER'] = '' + # Run command with script for TTY and output capture os.system(f"script -q -c {shlex.quote(shell_cmd)} {shlex.quote(output_path)}")