Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/strands_tools/shell.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,16 @@ def execute_with_pty(self, command: str, cwd: str, non_interactive_mode: bool) -

if pid == 0: # Child process
try:
# Ensure TERM is set for proper terminal emulation
os.environ.setdefault("TERM", "xterm-256color")

# Disable pagers in non-interactive mode to prevent hangs
# (e.g. git diff spawning 'less' which waits for input)
if non_interactive_mode:
os.environ.setdefault("GIT_PAGER", "cat")
os.environ.setdefault("PAGER", "cat")
os.environ.setdefault("MANPAGER", "cat")

os.chdir(cwd)
os.execvp("/bin/sh", ["/bin/sh", "-c", command])
except Exception as e:
Expand Down
Loading