Disable PAGERs for shell commands so agent can work autonomously
This commit is contained in:
parent
fd24484939
commit
36b80038ca
|
|
@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
- Improve ripgrep tool status output.
|
- Improve ripgrep tool status output.
|
||||||
- Added ask_human tool to allow human operator to answer questions asked by the agent.
|
- Added ask_human tool to allow human operator to answer questions asked by the agent.
|
||||||
- Handle keyboard interrupt (ctrl-c.)
|
- Handle keyboard interrupt (ctrl-c.)
|
||||||
|
- Disable PAGERs for shell commands so agent can work autonomously.
|
||||||
|
|
||||||
## [0.6.4] - 2024-12-19
|
## [0.6.4] - 2024-12-19
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -52,6 +52,10 @@ def run_interactive_command(cmd: List[str]) -> Tuple[bytes, int]:
|
||||||
os.remove(path)
|
os.remove(path)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
# Disable pagers by setting environment variables
|
||||||
|
os.environ['GIT_PAGER'] = ''
|
||||||
|
os.environ['PAGER'] = ''
|
||||||
|
|
||||||
# Run command with script for TTY and output capture
|
# Run command with script for TTY and output capture
|
||||||
os.system(f"script -q -c {shlex.quote(shell_cmd)} {shlex.quote(output_path)}")
|
os.system(f"script -q -c {shlex.quote(shell_cmd)} {shlex.quote(output_path)}")
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue