Xithrius / twitch-tui

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

Feature request: NO_COLOR standard implementation #629

Closed hellishvictor closed 3 months ago

hellishvictor commented 3 months ago

Hi, it would be great implement the NO_COLOR standard on twitch-tui since there's many CLI already with it (jaq, miller, crop, upx, python, xq, etc..,) and save the users from use "color=never", "--monochrome-color" or whatever.

Command-line software which adds ANSI color to its output by default should check
 for a NO_COLOR environment variable that, when present and not an empty string
 (regardless of its value), prevents the addition of ANSI color.

By adopting this standard, users that prefer to have plain, non-colored text output
 can export NO_COLOR=1 to their shell’s environment and automatically disable color
 by default in all supported software.

If your software outputs color by default, please consider not doing so. 

More info on: https://no-color.org/

Cheers

Xithrius commented 3 months ago

Thank you for the feature request. I see no problem with implementing this. Hopefully I can get it done within the next week or so.

Xithrius commented 3 months ago

Started development with draft PR https://github.com/Xithrius/twitch-tui/pull/632

Xithrius commented 3 months ago

Sorry for the wait. This feature is now available in https://github.com/Xithrius/twitch-tui/releases/tag/v2.6.14. Please let me know if I've missed anything. Thanks!

hellishvictor commented 3 months ago

Hi, glad that finally is implemented, but seems that still something is missing out: sshot-1

And here is how it shows when there's an error: sshot-2

I've already set up the "COLORBT_SHOW_HIDDEN=1" enviroment variable. Cheers.

Xithrius commented 3 months ago

Besides the winapi error, looks like there's a problem with the config. Could you send it, excluding the token? Thanks.

hellishvictor commented 3 months ago

No problem:

[terminal]
# The delay in milliseconds between terminal updates.
tick_delay = 30
# The maximum amount of messages that can be rendered.
maximum_messages = 500
# The file to put logs in.
log_file = ""
# if verbose (debug) logging should be enabled.
verbose = false
# What state the application should start in.
# Options: dashboard, normal, and help.
first_state = "dashboard"

[storage]
# If previous channels switched to should be tracked.
# If enabled, the channel switcher search the user's previously switched to channels.
channels = false
# If previous username mentions should be tracked.
# If enabled, the chat input box will search previously mentioned users, given that
# the first character in the input box is `@`.
mentions = false

[filters]
# If filters should be enabled.
# Filters can be configured by placing a `filters.txt` file in the same directory
# as the config file.
# Each new filter is to be put on a new line.
# Regex can be used, where as keywords will also try to match anything in a message.
enabled = false
# If the regex filters should be reversed.
# This means that everything in the filters file will be accepted.
reversed = false

[frontend]
# If the time and date is to be shown in the chat window.
show_datetimes = true
# The format of string that will show up in the terminal.
# Specification of formatting datetime strings can be found here: https://strftime.org/
datetime_format = "%a %b %e %T %Y"
# If usernames should be shown in the chat window.
username_shown = true
# The color palette for usernames.
# Options: pastel, vibrant, warm, and cool.
palette = "pastel"
# Show the title values at the top of the terminal.
title_shown = true
# The amount of space between the chat window and the terminal border.
margin = 0
# Show twitch badges next to usernames.
badges = false
# Color theme, being either light or dark.
theme = "dark"
# If your username should be highlighted when it appears in chat.
username_highlight = true
# If there should be state tabs shown on the bottom of the terminal.
state_tabs = false
# The shape of the cursor in insert boxes.
# Options: user (current terminal cursor), line, underscore, and block.
cursor_shape = "block"
# If the cursor should be blinking.
blinking_cursor = false
# If mouse scrolling should be inverted.
inverted_scrolling = false
# If scroll offset integer should be shown.
show_scroll_offset = true
# If Twitch emotes should be displayed (requires kitty terminal).
twitch_emotes = false
# If BetterTTV emotes should be displayed (requires kitty terminal).
betterttv_emotes = false
# If 7TV emotes should be displayed (requires kitty terminal).
seventv_emotes = false
# If FrankerFaceZ emotes should be displayed (requires kitty terminal).
frankerfacez_emotes = false
# Channel names to always be displayed in the start screen (dashboard).
# Example: ["Xithrius", "RocketLeague", "AntVenom"]
favorite_channels = []
# The amount of recently connected to channels shown on the start screen.
recent_channel_count = 5
# What style the border of the terminal should have.
# Options: plain, rounded, double, and thick.
border_type = "plain"
# If the usernames should be aligned to the right.
# They will be shown to the left if this is disabled.
right_align_usernames = false
Xithrius commented 3 months ago

Looks like the first section here is missing, which is what the error is coming from.

https://github.com/Xithrius/twitch-tui/blob/main/default-config.toml#L1-L13

hellishvictor commented 3 months ago

Yes, it's there, but as the token is excluded and the other two items in there are the username, server and channel, I just didn't include that section; however I should have mention that.

Xithrius commented 3 months ago

What windows version are you on? I think I might know of a solution, it just seems like underlining text isn't supported(?), possible way to fix is just not having underlines anywhere in the code. I'll be able to test this later.

hellishvictor commented 3 months ago

I'm on Windows 7 SP1 x64.

Xithrius commented 3 months ago

I'm seeing issues with the same problem that you're describing. I'll see if I can get a fix going soonish.

Xithrius commented 2 months ago

Could you create a new issue for this?

hellishvictor commented 2 months ago

Done.