From fe808a67dbc2ea3c4981b6c74749c9cc90daf888 Mon Sep 17 00:00:00 2001 From: Roland Walker Date: Sat, 7 Mar 2026 10:35:30 -0500 Subject: [PATCH] ability to turn off the toolbar When the toolbar was made customizable, there was already a default toolbar. To be extra sure we were compatible with any myclirc in the world, the empty value for a toolbar format was made the same as the default toolbar. This introduces a special value None which makes the toolbar disappear in the UI. Motivation: the user may prefer the information in, for instance, a tmux window title, or the prompt. Or just a simpler UI. --- changelog.md | 1 + mycli/main.py | 14 +++++++++----- mycli/myclirc | 3 ++- test/myclirc | 3 ++- 4 files changed, 14 insertions(+), 7 deletions(-) diff --git a/changelog.md b/changelog.md index b509892c..0df3c1f5 100644 --- a/changelog.md +++ b/changelog.md @@ -4,6 +4,7 @@ Upcoming (TBD) Features --------- * Dynamic terminal titles based on prompt format strings. +* Ability to turn off the toolbar. Internal diff --git a/mycli/main.py b/mycli/main.py index a501ae85..3c57f31f 100755 --- a/mycli/main.py +++ b/mycli/main.py @@ -1275,11 +1275,15 @@ def one_iteration(text: str | None = None) -> None: query = Query(text, successful, mutating) self.query_history.append(query) - get_toolbar_tokens = create_toolbar_tokens_func( - self, - show_initial_toolbar_help, - self.toolbar_format, - ) + if self.toolbar_format.lower() == 'none': + get_toolbar_tokens = None + else: + get_toolbar_tokens = create_toolbar_tokens_func( + self, + show_initial_toolbar_help, + self.toolbar_format, + ) + if self.wider_completion_menu: complete_style = CompleteStyle.MULTI_COLUMN else: diff --git a/mycli/myclirc b/mycli/myclirc index 2daf1e78..b06c77a6 100644 --- a/mycli/myclirc +++ b/mycli/myclirc @@ -136,7 +136,8 @@ prompt_continuation = '->' # # If \B is included, the additional content will begin on the next line. More # lines can be added with \n. If \B is not included, the customized toolbar -# can be a single line. +# can be a single line. An empty value is the same as the default "\B". The +# special literal value "None" will suppress the toolbar from appearing. toolbar = '' # Use the same prompt format strings to construct a terminal tab title. diff --git a/test/myclirc b/test/myclirc index 8c9f8105..d10b90ee 100644 --- a/test/myclirc +++ b/test/myclirc @@ -134,7 +134,8 @@ prompt_continuation = -> # # If \B is included, the additional content will begin on the next line. More # lines can be added with \n. If \B is not included, the customized toolbar -# can be a single line. +# can be a single line. An empty value is the same as the default "\B". The +# special literal value "None" will suppress the toolbar from appearing. toolbar = '' # Use the same prompt format strings to construct a terminal tab title.