Open catap opened 2 days ago
You can configure the colors: https://beets.readthedocs.io/en/stable/reference/config.html#colors
@arsaboo yes, I can. But this bug can be reproduced with default setting of Xterm.
Do you have a suggested fix for this @catap? It seems relatively easy to change from a user's settings. Perhaps a change of the default colours for people who haven't set it specifically?
I think that default settings should be useful for both dark and light themes, at least it was true before 2.0.0
Just for records, here how it looks at default settings of xterm:
The next step, I've tried to use lightgray
instead of white
as it state in docs. But I can't, it leads to:
Traceback (most recent call last):
File "/usr/local/bin/beet", line 8, in <module>
sys.exit(main())
^^^^^^
File "/usr/local/lib/python3.11/site-packages/beets/ui/__init__.py", line 1865, in main
_raw_main(args)
File "/usr/local/lib/python3.11/site-packages/beets/ui/__init__.py", line 1852, in _raw_main
subcommand.func(lib, suboptions, subargs)
File "/usr/local/lib/python3.11/site-packages/beets/ui/commands.py", line 1395, in import_func
import_files(lib, paths, query)
File "/usr/local/lib/python3.11/site-packages/beets/ui/commands.py", line 1326, in import_files
session.run()
File "/usr/local/lib/python3.11/site-packages/beets/importer.py", line 360, in run
pl.run_parallel(QUEUE_SIZE)
File "/usr/local/lib/python3.11/site-packages/beets/util/pipeline.py", line 447, in run_parallel
raise exc_info[1].with_traceback(exc_info[2])
File "/usr/local/lib/python3.11/site-packages/beets/util/pipeline.py", line 312, in run
out = self.coro.send(msg)
^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/beets/util/pipeline.py", line 171, in coro
task = func(*(args + (task,)))
^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/beets/importer.py", line 1521, in user_query
task.choose_match(session)
File "/usr/local/lib/python3.11/site-packages/beets/importer.py", line 949, in choose_match
choice = session.choose_match(self)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/beets/ui/commands.py", line 1040, in choose_match
path_str = ui.colorize("import_path", path_str0)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/beets/ui/__init__.py", line 618, in colorize
raise ValueError("no such ANSI code %s", code)
ValueError: ('no such ANSI code %s', 'lightgray')
Probably a way to fix it. First, we need to move to 4-bit ansi colors as:
modified beets/ui/__init__.py
@@ -533,6 +533,14 @@ ANSI_CODES = {
"magenta": 35,
"cyan": 36,
"white": 37,
+ "bright_black": 90,
+ "bright_red": 91,
+ "bright_green": 92,
+ "bright_yellow": 93,
+ "bright_blue": 94,
+ "bright_magenta": 95,
+ "bright_cyan": 96,
+ "bright_white": 97,
# Background colors.
"bg_black": 40,
"bg_red": 41,
@@ -542,6 +550,14 @@ ANSI_CODES = {
"bg_magenta": 45,
"bg_cyan": 46,
"bg_white": 47,
+ "bg_bright_black": 100,
+ "bg_bright_red": 101,
+ "bg_bright_green": 102,
+ "bg_bright_yellow": 103,
+ "bg_bright_blue": 104,
+ "bg_bright_magenta": 105,
+ "bg_bright_cyan": 106,
+ "bg_bright_white": 107,
}
RESET_COLOR = COLOR_ESCAPE + "39;49;00m"
after that I may use bright colors as:
modified beets/config_default.yaml
@@ -122,7 +122,7 @@ ui:
text_warning: ['bold', 'yellow']
text_error: ['bold', 'red']
text_highlight: ['bold', 'red']
- text_highlight_minor: ['white']
+ text_highlight_minor: ['bright_white']
action_default: ['bold', 'cyan']
action: ['bold', 'cyan']
# New Colors
@@ -130,16 +130,16 @@ ui:
text_faint: ['faint']
import_path: ['bold', 'blue']
import_path_items: ['bold', 'blue']
- added: ['green']
- removed: ['red']
- changed: ['yellow']
+ added: ['bright_green']
+ removed: ['bright_red']
+ changed: ['bright_yellow']
added_highlight: ['bold', 'green']
removed_highlight: ['bold', 'red']
changed_highlight: ['bold', 'yellow']
text_diff_added: ['bold', 'red']
text_diff_removed: ['bold', 'red']
text_diff_changed: ['bold', 'red']
- action_description: ['white']
+ action_description: ['bright_white']
import:
indentation:
match_header: 2
which leads to UI like:
Problem
When someoen uses non dark theme, like me for last couple of weeks, it leads to almost not usefull UI.
See:
This is regression was introduced by https://github.com/beetbox/beets/pull/3721
You may reproduce it by using this xterm theme: https://github.com/janoamaral/Xresources-themes/blob/master/light/PaperColor.Xresources
Setup
My configuration (output of
beet config
) is: