From 45b20f9ebc32af06d1a17d86bb96368a81059113 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B2=88=E6=A5=9A=E5=9F=8E?= Date: Thu, 19 Sep 2024 12:33:07 +0000 Subject: [PATCH] Update terminal.py --- metagpt/tools/libs/terminal.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/metagpt/tools/libs/terminal.py b/metagpt/tools/libs/terminal.py index 6d6934ac7..24daa184d 100644 --- a/metagpt/tools/libs/terminal.py +++ b/metagpt/tools/libs/terminal.py @@ -110,8 +110,7 @@ class Terminal: async def _read_and_process_output(self, cmd, daemon=False) -> str: async with self.observer as observer: cmd_output = [] - if cmd != "pwd": - await observer.async_report(cmd + self.command_terminator, "cmd") + await observer.async_report(cmd + self.command_terminator, "cmd") # report the command # Read the output until the unique marker is found. # We read bytes directly from stdout instead of text because when reading text, @@ -128,14 +127,12 @@ class Terminal: if ix >= 0: line = line[0:ix] if line: - if cmd != "pwd": - await observer.async_report(line, "output") + await observer.async_report(line, "output") # report stdout in real-time cmd_output.append(line) return "".join(cmd_output) # log stdout in real-time - if cmd != "pwd": - await observer.async_report(line, "output") + await observer.async_report(line, "output") cmd_output.append(line) if daemon: await self.stdout_queue.put(line)