fix: replace Ctrl-S confirm with Ctrl-G in Certificate Details form

Ctrl-S (0x13) is the XOFF flow-control character; terminals intercept it
before curses sees it, causing output suspension in Konsole and others.
Replaced with Ctrl-G (0x07 / BEL) which has no terminal-level meaning.
Updated hint bar and test stub accordingly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Vlad Doloman
2026-06-24 13:47:14 +03:00
parent 59e52b9465
commit 567c3e9759
2 changed files with 3 additions and 2 deletions

View File

@@ -617,7 +617,7 @@ def show_cert_form(
fields[name].draw() fields[name].draw()
fields[active[focus]].place_cursor() fields[active[focus]].place_cursor()
hint = "Tab=next F5=regen password Ctrl-S=confirm Esc=cancel" hint = "Tab=next F5=regen password Ctrl-G=confirm Esc=cancel"
try: try:
win.addstr(h - 2, 2, hint[:w - 4], curses.color_pair(COLOR_DISABLED)) win.addstr(h - 2, 2, hint[:w - 4], curses.color_pair(COLOR_DISABLED))
except curses.error: except curses.error:
@@ -629,7 +629,7 @@ def show_cert_form(
if key == 27: if key == 27:
curses.curs_set(0) curses.curs_set(0)
return CertFormResult(cn=cn, email="", password="", confirmed=False) return CertFormResult(cn=cn, email="", password="", confirmed=False)
if key == 0x13: # Ctrl-S: immediate submit if key == 0x07: # Ctrl-G: immediate submit
curses.curs_set(0) curses.curs_set(0)
return _submit() return _submit()
if key == 9: # Tab if key == 9: # Tab

View File

@@ -8,6 +8,7 @@ import curses as _curses
# Stub curses constants before importing the module under test, mirroring # Stub curses constants before importing the module under test, mirroring
# what test_widgets.py does for InputField's dependencies. # what test_widgets.py does for InputField's dependencies.
_curses.color_pair = lambda x: 0 _curses.color_pair = lambda x: 0
_curses.curs_set = lambda x: None
_curses.A_UNDERLINE = 0 _curses.A_UNDERLINE = 0
_curses.A_BOLD = 0 _curses.A_BOLD = 0
_curses.KEY_BACKSPACE = 263 _curses.KEY_BACKSPACE = 263