diff options
| author | Carson Fleming <cflems@cflems.net> | 2022-12-26 07:00:47 -0800 |
|---|---|---|
| committer | Carson Fleming <cflems@cflems.net> | 2022-12-26 07:00:47 -0800 |
| commit | b6e70756b88f9014cf9fc518c09baa0937055517 (patch) | |
| tree | 5ac9f25e6acc7c356df6fab0fc4a02e9f085a2e9 /pkctl.py | |
| parent | a7fc7c205f68e5519640b2c60fada27d5cc1761c (diff) | |
| download | pk-b6e70756b88f9014cf9fc518c09baa0937055517.tar.gz | |
Make correction to avoid utf-8ing control sequences
Diffstat (limited to 'pkctl.py')
| -rw-r--r-- | pkctl.py | 17 |
1 files changed, 7 insertions, 10 deletions
@@ -83,25 +83,25 @@ def attach_cmd(): reader_thread.start() while state['attached']: try: - line = input().strip() + line = bytes(input().strip(), 'utf-8') except EOFError: print('detach') - line = 'detach' - if line == 'detach': + line = b'detach' + if line == b'detach': try: sock.sendall(b'\xde\xad') except: pass state['attached'] = False - elif line == 'clear': + elif line == b'clear': os.system('clear') - line = '\xc0\xdeprompt' + line = b'\xc0\xdeprompt' elif len(line) < 1: - line = '\xc0\xdeprompt' + line = b'\xc0\xdeprompt' if not state['attached']: break try: - sock.sendall(bytes(line, 'utf-8')) + sock.sendall(line) except: state['attached'] = False break @@ -111,9 +111,6 @@ def attach_cmd(): reader_thread.join() return True -def exec_cmd(*args): - pass - def main(): if len(sys.argv) < 2 or sys.argv[1] == 'help': print_help() |
