Crash when using color in 1to1 chat
When I want to send a colored message, I type Ctrl+c, , I type my message and poezio crashes right after the message is sent (the contact receives the message properly formatted).
The bold command (Ctrl+c, b) is not affected.
An example when I send "test test test", with the second word in yellow :
Traceback (most recent call last):
File "src/poezio.py", line 39, in
main()
File "src/poezio.py", line 36, in main
cocore.main_loop() # Refresh the screen, wait for user events etc
File "/home/gnuzer/poezio/src/core.py", line 742, in main_loop
res = self.do_command(char)
File "/home/gnuzer/poezio/src/core.py", line 1542, in do_command
return self.current_tab().on_input(key)
File "/home/gnuzer/poezio/src/tabs.py", line 1946, in on_input
self.key_func[key]()
File "/home/gnuzer/poezio/src/tabs.py", line 326, in on_enter
self.command_say(txt)
File "/home/gnuzer/poezio/src/tabs.py", line 1883, in command_say
self.text_win.refresh()
File "/home/gnuzer/poezio/src/windows.py", line 641, in refresh
self.write_text(y, (3 if line.msg.nickname else 1) +
len(line.msg.str_time)+len(truncate_nick(line.msg.nickname) or ''),
line.msg.txt[line.start_pos:line.end_pos])
File "/home/gnuzer/poezio/src/windows.py", line 654, in write_text
self.addstr_colored(txt, y, x)
File "/home/gnuzer/poezio/src/windows.py", line 141, in
addstr_colored
self._win.attron(to_curses_attr((int(color_str), -1)))
ValueError: invalid literal for int() with base 10: '3test
\x19otest\x19'