from blessed import Terminal as BlessedTerminal
-PORT = 6667
TIMEOUT_CONNECT = 5
TIMEOUT_LOOP = 0.1
CONN_RECV_BUFSIZE = 1024
'disconnect': 'window.disconnect',
'reconnect': 'window.reconnect'
}
+
B64_PREFIX = 'b64:'
OSC52_PREFIX = ']52;c;'
PASTE_DELIMITER = '\007'
PROMPT_ELL_IN = '<…'
PROMPT_ELL_OUT = '…>'
+PORT = 6667
IRCSPEC_LINE_SEPARATOR = b'\r\n'
IRCSPEC_TAG_ESCAPES = ((r'\:', ';'),
(r'\s', ' '),
if self._cursor_x > len(self._input_buffer):
content += ' '
half_width = self._width // 2
- to_write = f'{prompt}{content}'
offset = 0
- if len(to_write) > self._width and self._cursor_x > half_width:
- prompt = f'{PROMPT_TEMPLATE}{PROMPT_ELL_IN}'
+ if len(prompt) + len(content) > self._width\
+ and self._cursor_x > half_width:
+ prompt += PROMPT_ELL_IN
if self._cursor_x > len(content) - half_width:
offset = len(content) - self._width + len(prompt)
else:
- offset = self._cursor_x - half_width + len(prompt) // 2
+ offset = self._cursor_x - half_width + (len(prompt) // 2)
cursor_x_to_write = len(prompt) - 1 + self._cursor_x - offset
to_write = f'{prompt}{content[offset:]}'
if len(to_write) > self._width: