From a1ebcfcb4ccb983d9ef243d05072f85bd50bc0a5 Mon Sep 17 00:00:00 2001 From: Luxferre Date: Fri, 26 Dec 2025 09:37:38 +0200 Subject: [PATCH] print_paged QOL improvement --- deck/pager.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/deck/pager.py b/deck/pager.py index c89bb7a..b9cf0d5 100644 --- a/deck/pager.py +++ b/deck/pager.py @@ -16,7 +16,7 @@ except: # additional constants REAL_TERM_COLS = TERM_COLS - 1 # for the line ending character REAL_TERM_ROWS = TERM_ROWS - 1 # for the "press Enter" message -CONT_MSG = '--- Press Enter ---' +CONT_MSG = '--- Press Enter to continue, q+Enter to stop ---' def term_size(): """Return the detected terminal size (rows, columns)""" @@ -42,5 +42,7 @@ def print_paged(text): chunk = lines[0:REAL_TERM_ROWS] for line in chunk: print(line) lines = lines[REAL_TERM_ROWS:] - if len(lines) > 0: input(CONT_MSG) + if len(lines) > 0: + r = input(CONT_MSG) + if r == 'q' or r == 'Q': break else: break