-
Notifications
You must be signed in to change notification settings - Fork 117
Open
Description
I was trying to provide LLM a shell by using pyte, after some actions I got caught by these error:
Traceback (most recent call last):
... i should hide them as they are irrelevant and maybe confidential ...
File "/app/al1s_terminal_driver/driver.py", line 79, in get_buffer
return self.pyte_screen.display
^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/pyte/screens.py", line 244, in display
return ["".join(render(self.buffer[y])) for y in range(self.lines)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/pyte/screens.py", line 241, in render
is_wide_char = wcwidth(char[0]) == 2
~~~~^^^
IndexError: string index out of range
Steps to reproduce:
- Use paramiko to SSH into a kali server/container
- Connect the SSH channel to pyte, with these code:
channel = paramiko_ssh_client.invoke_shell(term='linux', width=width, height=height)
screen = pyte.Screen(width, height)
stream = pyte.ByteStream(screen)
# read from ssh, you may need to run these code below in another thread.
while True:
data = channel.recv(1)
stream.feed(data)
- Send some Chinese character via
channel#sendmethod (in this example:subfinder工具已成功安装。软件包信息显示版本为2.12.0-0kali2,并且系统确认它已是最新版本。安装过程顺利完成。was the last thing sent before the error) - Invoke
screen.dirty.clear()andscreen.display, error occurs.
The shell connected was in Kali Linux
I was on pyte==0.8.2. However I checked the source but things mismatches (and seems already fixed). Maybe tag a newer release to pypi?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels