zulip-terminal: Crashed if stream color in short syntax

Hi there.

zulip-term crashed if stream color in short syntax. I.e. #f00 instead of #ff0000. Why it’s short? I set it before using web-version of zulip to red via color-picker

zulip-term
Loading with:
   theme 'gruvbox' specified in zuliprc file.
   autohide setting 'autohide' specified in zuliprc file.
Welcome to Zulip.
Loading |['food-stalker', 19, '#123456', True] <- debug string print(properties) from ui_tools/buttons.py:71
['general', 4, '#f00', False]
Traceback (most recent call last):
Loading /  File "/tmp/zt/lib/python3.5/site-packages/zulipterminal/cli/run.py", line 169, in main
    autohide_setting).main()
  File "/tmp/zt/lib/python3.5/site-packages/zulipterminal/core.py", line 38, in __init__
    self.view = View(self)
  File "/tmp/zt/lib/python3.5/site-packages/zulipterminal/ui.py", line 35, in __init__
    super(View, self).__init__(self.main_window())
  File "/tmp/zt/lib/python3.5/site-packages/zulipterminal/ui.py", line 89, in main_window
    self.left_column = self.left_column_view()
  File "/tmp/zt/lib/python3.5/site-packages/zulipterminal/ui.py", line 38, in left_column_view
    self.left_col_w = LeftColumnView(self)
  File "/tmp/zt/lib/python3.5/site-packages/zulipterminal/ui_tools/views.py", line 463, in __init__
    self.streams_view(),
  File "/tmp/zt/lib/python3.5/site-packages/zulipterminal/ui_tools/views.py", line 492, in streams_view
    ) for stream in self.view.pinned_streams]
  File "/tmp/zt/lib/python3.5/site-packages/zulipterminal/ui_tools/views.py", line 492, in <listcomp>
    ) for stream in self.view.pinned_streams]
  File "/tmp/zt/lib/python3.5/site-packages/zulipterminal/ui_tools/buttons.py", line 72, in __init__
    self.color = color[:2] + color[3] + color[5]
IndexError: string index out of range
Zulip Terminal has crashed!

So when I set channel(stream) color to something like #123456 via web-version, term works fine.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 18 (6 by maintainers)

Commits related to this issue

Most upvoted comments

@neiljp Confirmed this fixes the issue with server version 1.9.0; tried a few different 3-character hex color codes and they all load and render correctly.