diff --git a/src/prompt_toolkit/styles/defaults.py b/src/prompt_toolkit/styles/defaults.py index 2faba9437..6b60c8248 100644 --- a/src/prompt_toolkit/styles/defaults.py +++ b/src/prompt_toolkit/styles/defaults.py @@ -74,7 +74,7 @@ ("completion-menu.completion fuzzymatch.outside", "fg:#444444"), ("completion-menu.completion fuzzymatch.inside", "bold"), ("completion-menu.completion fuzzymatch.inside.character", "underline"), - ("completion-menu.completion.current fuzzymatch.outside", "fg:default"), + ("completion-menu.completion.current fuzzymatch.outside", "fg:#444444"), ("completion-menu.completion.current fuzzymatch.inside", "nobold"), # Styling of readline-like completions. ("readline-like-completions", ""), diff --git a/tests/test_default_style.py b/tests/test_default_style.py new file mode 100644 index 000000000..81ca53e4d --- /dev/null +++ b/tests/test_default_style.py @@ -0,0 +1,13 @@ +from prompt_toolkit.styles.defaults import default_ui_style + + +def test_selected_fuzzy_completion_outside_colors() -> None: + attrs = default_ui_style().get_attrs_for_style_str( + "class:completion-menu.completion.current class:fuzzymatch.outside" + ) + + # Reverse makes the foreground the background: it must not depend on the + # terminal foreground, which can be white like the selected text. + assert attrs.color == "444444" + assert attrs.bgcolor == "ffffff" + assert attrs.reverse