mirror of
https://github.com/rwinkhart/sshyp.git
synced 2026-10-27 04:39:56 -04:00
Allow displaying partial options in curses menus in smaller terminals
This commit is contained in:
1 parent
0e45a21a58
commit
e044122d48
1 file changed
+4
@@ -62,10 +62,14 @@ def curses_radio(_options, _pretext):
|
|||||||
if _button_gen:
|
if _button_gen:
|
||||||
for _i, _option in enumerate(_options):
|
for _i, _option in enumerate(_options):
|
||||||
_y = _i + _current_line + 1
|
_y = _i + _current_line + 1
|
||||||
|
if _y < _height:
|
||||||
if _i == _selected:
|
if _i == _selected:
|
||||||
stdscr.addstr(_y, 0, "[*] " + _option, A_REVERSE)
|
stdscr.addstr(_y, 0, "[*] " + _option, A_REVERSE)
|
||||||
else:
|
else:
|
||||||
stdscr.addstr(_y, 0, "[ ] " + _option)
|
stdscr.addstr(_y, 0, "[ ] " + _option)
|
||||||
|
else:
|
||||||
|
stdscr.addstr(_y-1, 0, '# warning: re-size terminal to see more information')
|
||||||
|
break
|
||||||
|
|
||||||
# update _selected based on user input
|
# update _selected based on user input
|
||||||
_key = stdscr.getch()
|
_key = stdscr.getch()
|
||||||
|
|||||||
Reference in new issue
Block a user