mirror of
https://github.com/agent0ai/agent-zero.git
synced 2026-04-29 20:20:42 +00:00
shell improvements
This commit is contained in:
parent
73778cdd34
commit
07e3e59e6f
4 changed files with 19 additions and 87 deletions
|
|
@ -41,7 +41,7 @@ class SSHInteractiveSession:
|
|||
allow_agent=False,
|
||||
look_for_keys=False,
|
||||
)
|
||||
self.shell = self.client.invoke_shell(width=80, height=40)
|
||||
self.shell = self.client.invoke_shell(width=100, height=50)
|
||||
# self.shell.send(f'PS1="{SSHInteractiveSession.ps1_label}"'.encode())
|
||||
# return
|
||||
while True: # wait for end of initial output
|
||||
|
|
@ -193,6 +193,9 @@ class SSHInteractiveSession:
|
|||
ansi_escape = re.compile(r"\x1B(?:[@-Z\\-_]|\[[0-?]*[ -/]*[@-~])")
|
||||
cleaned = ansi_escape.sub("", input_string)
|
||||
|
||||
# remove null bytes
|
||||
cleaned = cleaned.replace("\x00", "")
|
||||
|
||||
# Replace '\r\n' with '\n'
|
||||
cleaned = cleaned.replace("\r\n", "\n")
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue