Skip to content

Commit 9d48733

Browse files
Remove curtsies fill_terminal option
At some point I thought character-perfect matching of bpython.cli was important, but if folks want that UI, use cli!
1 parent de56af5 commit 9d48733

File tree

3 files changed

+7
-36
lines changed

3 files changed

+7
-36
lines changed

bpython/config.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ def loadini(struct, configfile):
8989
},
9090
'curtsies': {
9191
'list_above' : False,
92-
'fill_terminal' : False,
9392
'right_arrow_completion' : True,
9493
}})
9594
if not config.read(config_path):
@@ -157,7 +156,6 @@ def loadini(struct, configfile):
157156
struct.save_append_py = config.getboolean('general', 'save_append_py')
158157

159158
struct.curtsies_list_above = config.getboolean('curtsies', 'list_above')
160-
struct.curtsies_fill_terminal = config.getboolean('curtsies', 'fill_terminal')
161159
struct.curtsies_right_arrow_completion = config.getboolean('curtsies', 'right_arrow_completion')
162160

163161
color_scheme_name = config.get('general', 'color_scheme')

bpython/curtsiesfrontend/repl.py

Lines changed: 7 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -272,12 +272,7 @@ def smarter_request_reload(desc):
272272
self.get_term_hw = get_term_hw
273273
self.get_cursor_vertical_diff = get_cursor_vertical_diff
274274

275-
self.status_bar = StatusBar(
276-
(_(" <%s> Rewind <%s> Save <%s> Pastebin <%s> Editor")
277-
% (config.undo_key, config.save_key, config.pastebin_key, config.external_editor_key)
278-
if config.curtsies_fill_terminal else ''),
279-
refresh_request=self.request_refresh
280-
)
275+
self.status_bar = StatusBar('', refresh_request=self.request_refresh)
281276
self.edit_keys = edit_keys.mapping_with_config(config, key_dispatch)
282277
logger.debug("starting parent init")
283278
super(Repl, self).__init__(interp, config)
@@ -1009,18 +1004,15 @@ def paint(self, about_to_exit=False, user_quit=False):
10091004
self.clean_up_current_line_for_exit() # exception to not changing state!
10101005

10111006
width, min_height = self.width, self.height
1012-
show_status_bar = bool(self.status_bar.should_show_message) or (self.config.curtsies_fill_terminal or self.status_bar.has_focus)
1007+
show_status_bar = bool(self.status_bar.should_show_message) or self.status_bar.has_focus
10131008
if show_status_bar:
10141009
min_height -= 1
10151010

10161011
current_line_start_row = len(self.lines_for_display) - max(0, self.scroll_offset)
10171012
#current_line_start_row = len(self.lines_for_display) - self.scroll_offset
10181013
if self.request_paint_to_clear_screen: # or show_status_bar and about_to_exit ?
10191014
self.request_paint_to_clear_screen = False
1020-
if self.config.curtsies_fill_terminal: #TODO clean up this logic - really necessary check?
1021-
arr = FSArray(self.height - 1 + current_line_start_row, width)
1022-
else:
1023-
arr = FSArray(self.height + current_line_start_row, width)
1015+
arr = FSArray(min_height + current_line_start_row, width)
10241016
else:
10251017
arr = FSArray(0, width)
10261018
#TODO test case of current line filling up the whole screen (there aren't enough rows to show it)
@@ -1106,23 +1098,11 @@ def paint(self, about_to_exit=False, user_quit=False):
11061098

11071099
logger.debug('about to exit: %r', about_to_exit)
11081100
if show_status_bar:
1109-
if self.config.curtsies_fill_terminal:
1110-
if about_to_exit:
1111-
arr[max(arr.height, min_height), :] = FSArray(1, width)
1112-
else:
1113-
arr[max(arr.height, min_height), :] = paint.paint_statusbar(1, width, self.status_bar.current_line, self.config)
1114-
1115-
if self.presentation_mode:
1116-
rows = arr.height
1117-
columns = arr.width
1118-
last_key_box = paint.paint_last_events(rows, columns, [events.pp_event(x) for x in self.last_events if x])
1119-
arr[arr.height-last_key_box.height:arr.height, arr.width-last_key_box.width:arr.width] = last_key_box
1101+
statusbar_row = min_height + 1 if arr.height == min_height else arr.height
1102+
if about_to_exit:
1103+
arr[statusbar_row, :] = FSArray(1, width)
11201104
else:
1121-
statusbar_row = min_height + 1 if arr.height == min_height else arr.height
1122-
if about_to_exit:
1123-
arr[statusbar_row, :] = FSArray(1, width)
1124-
else:
1125-
arr[statusbar_row, :] = paint.paint_statusbar(1, width, self.status_bar.current_line, self.config)
1105+
arr[statusbar_row, :] = paint.paint_statusbar(1, width, self.status_bar.current_line, self.config)
11261106

11271107
if self.config.color_scheme['background'] not in ('d', 'D'):
11281108
for r in range(arr.height):

doc/sphinx/source/configuration-options.rst

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -290,13 +290,6 @@ This refers to the ``[curtsies]`` section in your config file.
290290

291291
.. versionadded:: 0.13
292292

293-
fill_terminal
294-
^^^^^^^^^^^^^
295-
Default: False
296-
297-
Whether bpython should clear the screen on start, and always display a status
298-
bar at the bottom.
299-
300293
list_above
301294
^^^^^^^^^^
302295
Default: False

0 commit comments

Comments
 (0)