prompt-toolkit / prompt-toolkit/python-prompt-toolkit
Unable to change the background color of CompletionsMenu
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 10.6k
- Forks
- 815
- PR merge metrics
- No merged PRs in 30d
Description
In the current implementation of CompletionsMenu class, there is no option to change the style of a container. Because of this limitation, I cannot change the background color of the CompletionMenu.
Inprompt_toolkit/layout/menus.py:
class CompletionsMenu(ConditionalContainer):
# NOTE: We use a pretty big z_index by default. Menus are supposed to be
# above anything else. We also want to make sure that the content is
# visible at the point where we draw this menu.
def __init__(
self,
max_height: Optional[int] = None,
scroll_offset: Union[int, Callable[[], int]] = 0,
extra_filter: FilterOrBool = True,
display_arrows: FilterOrBool = False,
z_index: int = 10 ** 8,
) -> None:
I'd appreciate if someone who has run into this before and could provide a workaround for now.
Thanks!
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in prompt_toolkit/layout/menus.py at the CompletionsMenu constructor and inspect how its container styling is currently configured. Add a way to customize the menu container so callers can change its background color, then verify that the completions menu renders with the supplied styling.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100