File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed
Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -42,6 +42,11 @@ def from_env(cls) -> ColorDepth | None:
4242 This is a way to enforce a certain color depth in all prompt_toolkit
4343 applications.
4444 """
45+ # Disable color if a `NO_COLOR` environment variable is set.
46+ # See: https://no-color.org/
47+ if os .environ .get ("NO_COLOR" ):
48+ return cls .DEPTH_1_BIT
49+
4550 # Check the `PROMPT_TOOLKIT_COLOR_DEPTH` environment variable.
4651 all_values = [i .value for i in ColorDepth ]
4752 if os .environ .get ("PROMPT_TOOLKIT_COLOR_DEPTH" ) in all_values :
Original file line number Diff line number Diff line change 6363 # Completions menu.
6464 ("completion-menu" , "bg:#bbbbbb #000000" ),
6565 ("completion-menu.completion" , "" ),
66- ("completion-menu.completion.current" , "bg:#888888 #ffffff" ),
66+ # (Note: for the current completion, we use 'reverse' on top of fg/bg
67+ # colors. This is to have proper rendering with NO_COLOR=1).
68+ ("completion-menu.completion.current" , "fg:#888888 bg:#ffffff reverse" ),
6769 ("completion-menu.meta.completion" , "bg:#999999 #000000" ),
6870 ("completion-menu.meta.completion.current" , "bg:#aaaaaa #000000" ),
6971 ("completion-menu.multi-column-meta" , "bg:#aaaaaa #000000" ),
You can’t perform that action at this time.
0 commit comments