Skip to content

Commit 6352de2

Browse files
committed
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.
1 parent 17d63ce commit 6352de2

File tree

4 files changed

+21
-7
lines changed

4 files changed

+21
-7
lines changed

changelog.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
Upcoming (TBD)
2+
==============
3+
4+
Features
5+
---------
6+
* Ability to turn off the toolbar.
7+
8+
19
1.61.0 (2026/03/07)
210
==============
311

mycli/main.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1267,11 +1267,15 @@ def one_iteration(text: str | None = None) -> None:
12671267
query = Query(text, successful, mutating)
12681268
self.query_history.append(query)
12691269

1270-
get_toolbar_tokens = create_toolbar_tokens_func(
1271-
self,
1272-
show_initial_toolbar_help,
1273-
self.toolbar_format,
1274-
)
1270+
if self.toolbar_format.lower() == 'none':
1271+
get_toolbar_tokens = None
1272+
else:
1273+
get_toolbar_tokens = create_toolbar_tokens_func(
1274+
self,
1275+
show_initial_toolbar_help,
1276+
self.toolbar_format,
1277+
)
1278+
12751279
if self.wider_completion_menu:
12761280
complete_style = CompleteStyle.MULTI_COLUMN
12771281
else:

mycli/myclirc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,8 @@ prompt_continuation = '->'
136136
#
137137
# If \B is included, the additional content will begin on the next line. More
138138
# lines can be added with \n. If \B is not included, the customized toolbar
139-
# can be a single line.
139+
# can be a single line. An empty value is the same as the default "\B". The
140+
# special literal value "None" will suppress the toolbar from appearing.
140141
toolbar = ''
141142

142143
# Skip intro info on startup and outro info on exit

test/myclirc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,8 @@ prompt_continuation = ->
134134
#
135135
# If \B is included, the additional content will begin on the next line. More
136136
# lines can be added with \n. If \B is not included, the customized toolbar
137-
# can be a single line.
137+
# can be a single line. An empty value is the same as the default "\B". The
138+
# special literal value "None" will suppress the toolbar from appearing.
138139
toolbar = ''
139140

140141
# Skip intro info on startup and outro info on exit

0 commit comments

Comments
 (0)