Xithrius / twitch-tui

Twitch chat in the terminal.
https://xithrius.github.io/twitch-tui/
Apache License 2.0
458 stars 32 forks source link

"Terminal cell_size must be defined when emotes are enabled" #612

Closed slimelia closed 5 months ago

slimelia commented 5 months ago

Describe the bug: When trying to launch a Twitch channel chat in twitch-tui version 2.6.11, I get the error _"Terminal cellsize must be defined when emotes are enabled". This error did not occur in prior versions. Emotes are not enabled in the config file.

To Reproduce:

  1. Run twt in command-line
  2. Press Enter key to enter currently selected channel
  3. Chat window briefly appears
  4. Twitch-tui crashes

Expected behavior: Twitch-tui should recognise emotes are not enabled and display the chat.

Screenshots: image

System:

Additional context: This bug was not present prior to version 2.6.11; when I try running version 2.6.10 I can open the chat without issue.

EDIT - thought it might be pertinent to include a copy of my config file:

[twitch]
username = "slimelia"
channel = "kipbite"
server = "irc.chat.twitch.tv"
token = "REDACTED"

[terminal]
delay = 30
maximum_messages = 500
verbose = false
first_state = "Dashboard"

[storage]
channels = false
mentions = false

[filters]
enabled = false
reversed = false

[frontend]
show_datetimes = true
datetime_format = "%a %b %e %T %Y"
username_shown = true
palette = "pastel"
title_shown = true
margin = 0
badges = false
theme = "dark"
username_highlight = true
state_tabs = false
cursor_shape = "user"
blinking_cursor = false
inverted_scrolling = false
show_scroll_offset = false
twitch_emotes = false
betterttv_emotes = false
seventv_emotes = false
frankerfacez_emotes = false
favorite_channels = []
recent_channel_count = 5
border_type = "plain"
hide_chat_border = false
right_align_usernames = false
show_unsupported_screen_size = true
Xithrius commented 5 months ago

Thanks for the issue! It'll be around 12 hours until I can reproduce/fix this problem, sorry about that. However, I think I know where it's originating from, so hopefully it won't take too long to diagnose.

toxision commented 5 months ago

+1 on the same issue

Xithrius commented 5 months ago

Although I don't have access to my dev machine right now, I believe I found where the problem is originating from. The application is attempting to parse emotes no matter if they're enabled or not.

For those of you who know rust and the internals of this application, it's occurring here (and the same call in the function below it), and will probably be fixed by passing a reference to the shared config. Then, some control flow to see if emotes are enabled, and either returning a new payload with emotes or the original one passed in.

Xithrius commented 5 months ago

Alright, I've published a release that should fix this. I'm no longer able to reproduce a crash with this update.

Available at https://github.com/Xithrius/twitch-tui/releases/tag/v2.6.12

slimelia commented 5 months ago

Can confirm the issue seems resolved on my end too! Thank you!! 😊

Xithrius commented 5 months ago

No problem. Have a good one!