diff options
| author | Carson Fleming <cflems@cflems.net> | 2023-01-12 06:43:56 -0800 |
|---|---|---|
| committer | Carson Fleming <cflems@cflems.net> | 2023-01-12 06:43:56 -0800 |
| commit | 9a9c7ff09bbcf3ff5a7d8913ff00a25a2b7e0dc4 (patch) | |
| tree | fc4cc6e94fcf8e881f019fa8e95ea803bd6ed160 /pkctl.py | |
| parent | cbdff6d5266495c79eeaeedf97a5bb10d269d720 (diff) | |
| download | pk-9a9c7ff09bbcf3ff5a7d8913ff00a25a2b7e0dc4.tar.gz | |
Add some better logging/data stream tolerance to pkctl
Diffstat (limited to 'pkctl.py')
| -rw-r--r-- | pkctl.py | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -128,7 +128,12 @@ def attach_cmd(): stdin_mode = tty.tcgetattr(sys.stdin.fileno()) tty.setraw(sys.stdin.fileno()) else: - pnnl(str(data, 'utf-8')) + if data[:6] == b'\xc0\xdenpty': + pnnl(str(data[6:], 'utf-8')) + elif data[:2] == b'\xc0\xde': + print('Received bogus code from server', data) + else: + pnnl(str(data, 'utf-8')) sel.close() sock.close() if pty_mode: |
