Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: NO_COLOR standard implementation #629

Closed
hellishvictor opened this issue Jul 11, 2024 · 13 comments · Fixed by #632
Closed

Feature request: NO_COLOR standard implementation #629

hellishvictor opened this issue Jul 11, 2024 · 13 comments · Fixed by #632

Comments

@hellishvictor
Copy link

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
Copy link
Owner

Xithrius commented Jul 11, 2024

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
Copy link
Owner

Started development with draft PR #632

@Xithrius
Copy link
Owner

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
Copy link
Author

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
Copy link
Owner

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

@hellishvictor
Copy link
Author

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
Copy link
Owner

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
Copy link
Author

hellishvictor commented Jul 29, 2024

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
Copy link
Owner

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
Copy link
Author

hellishvictor commented Jul 29, 2024

I'm on Windows 7 SP1 x64.

@Xithrius
Copy link
Owner

Xithrius commented Jul 29, 2024

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

@Xithrius
Copy link
Owner

Xithrius commented Jul 30, 2024

Could you create a new issue for this?

@hellishvictor
Copy link
Author

Done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants