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

Flag to override terminal detection in CLI (QOL) #2274

Closed
hhhhhhhhhn opened this issue Jan 6, 2025 · 1 comment
Closed

Flag to override terminal detection in CLI (QOL) #2274

hhhhhhhhhn opened this issue Jan 6, 2025 · 1 comment
Labels
Feature Request Feature Request

Comments

@hhhhhhhhhn
Copy link

Requested Feature

Right now, spotDL auto-detects whether it is in a terminal or not and disables some features (like colors or progress bars) based on it, which is inherited from the rich library. This behaviour is not always desirable, and for this reason many programs (e.g. GNU coreutils) give an out in the form of a flag. Currently, it is possible to use the FORCE_COLOR and NO_COLOR environment variables, which rich uses, to override this, but it is not documented and is inconsistent with how the rest of the program is configured (through flags), so it would be nice to have a flag to configure this.

Possible implementation

I think a --color={always, never, auto} flag would the best option, as it is consistent with most other CLI programs. As spotDL uses the rich library with the global console (i.e. get_console()), this can be achieved with the reconfigure() function, particulary, with reconfigure(force_terminal=..., force_interactive=...). I've made a possible implementation, which adds an additional parameter to the init_logging functions, where rich is configured.

PD: Thanks for this amazing program!

@hhhhhhhhhn hhhhhhhhhn added the Feature Request Feature Request label Jan 6, 2025
@Silverarmor
Copy link
Member

Have you tried --simple-tui?

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

No branches or pull requests

2 participants