Skip to content

Commit

Permalink
fixes broken output in interactive shell
Browse files Browse the repository at this point in the history
  • Loading branch information
Wolfgang Hotwagner committed Mar 9, 2024
1 parent b137909 commit 08f9159
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/attackmate/executors/shell/shellexecutor.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,15 @@ def popen_interactive(self, proc: subprocess.Popen, cmd: bytes, timeout: int=5,
t.daemon = True
t.start()

line = b''
outline = b''
if read:
begin = datetime.now()
while (datetime.now() - begin ).total_seconds() < timeout:
if q.qsize() > 0:
line += q.get_nowait()
outline += q.get_nowait()
begin = datetime.now() # reset timer when data comes

return line.decode()
return outline.decode()


def _exec_cmd(self, command: ShellCommand) -> Result:
Expand Down

0 comments on commit 08f9159

Please sign in to comment.