mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-05-05 05:42:37 +02:00
add comment for terminal tool output parser
This commit is contained in:
parent
32d6e5a1cf
commit
e72246e0df
1 changed files with 4 additions and 3 deletions
|
|
@ -95,9 +95,10 @@ class Terminal:
|
|||
with self.observer as observer:
|
||||
cmd_output = []
|
||||
observer.report(cmd + self.command_terminator, "cmd")
|
||||
# report the command
|
||||
|
||||
# Read the output until the unique marker is found
|
||||
# report the comman
|
||||
# Read the output until the unique marker is found.
|
||||
# We read bytes directly from stdout instead of text because when reading text,
|
||||
# '\r' is changed to '\n', resulting in excessive output.
|
||||
tmp = b""
|
||||
while True:
|
||||
output = tmp + self.process.stdout.read(1)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue