From a7733fb4b27ab7cd8974747aae33ce8bd45bc0d6 Mon Sep 17 00:00:00 2001 From: zhanglei Date: Tue, 11 Jun 2024 16:23:36 +0800 Subject: [PATCH] =?UTF-8?q?update:=20terminal=E5=88=9D=E5=A7=8B=E5=8C=96?= =?UTF-8?q?=E7=9A=84=E6=97=B6=E5=80=99=E6=8A=8A=E7=8E=AF=E5=A2=83=E5=8F=98?= =?UTF-8?q?=E9=87=8F=E7=BB=99=E8=BF=87=E5=8E=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- metagpt/tools/libs/terminal.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/metagpt/tools/libs/terminal.py b/metagpt/tools/libs/terminal.py index e6d059636..7b0f124c0 100644 --- a/metagpt/tools/libs/terminal.py +++ b/metagpt/tools/libs/terminal.py @@ -1,3 +1,4 @@ +import os import subprocess import threading from queue import Queue @@ -19,6 +20,7 @@ class Terminal: self.shell_command = ["bash"] # FIXME: should consider windows support later self.command_terminator = "\n" + env = dict(os.environ) # Start a persistent shell process self.process = subprocess.Popen( self.shell_command, @@ -27,6 +29,7 @@ class Terminal: stdout=subprocess.PIPE, stderr=subprocess.STDOUT, executable="/bin/bash", + env=env ) self.stdout_queue = Queue() self.observer = TerminalReporter()