update: terminal初始化的时候把环境变量给过去

This commit is contained in:
zhanglei 2024-06-11 16:23:36 +08:00
parent 214688dc77
commit a7733fb4b2

View file

@ -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()