From 5951333d42ee3dc5ed5533157461fc68b3cfe8cf Mon Sep 17 00:00:00 2001 From: cthulhu <> Date: Thu, 18 Dec 2025 19:41:08 +0200 Subject: [PATCH 1/4] Fix: Restore terminal state on errors (try-finally) --- caesium.py | 39 +++++++++++++++++++++------------------ 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/caesium.py b/caesium.py index 25dfded..bda316a 100755 --- a/caesium.py +++ b/caesium.py @@ -1766,21 +1766,24 @@ def msg_list(echoarea, msgids, msgn): check_directories() load_lasts() stdscr = curses.initscr() -curses.start_color() -curses.use_default_colors() -load_colors() -curses.noecho() -curses.curs_set(False) -stdscr.keypad(True) - -stdscr.bkgd(" ", curses.color_pair(1)) -get_term_size() -if show_splash: - splash_screen() -draw_message_box("Подождите", False) -get_counts() -stdscr.clear() -echo_selector() -curses.echo() -curses.curs_set(True) -curses.endwin() +try: + curses.start_color() + curses.use_default_colors() + load_colors() + curses.noecho() + curses.curs_set(False) + stdscr.keypad(True) + + stdscr.bkgd(" ", curses.color_pair(1)) + get_term_size() + if show_splash: + splash_screen() + draw_message_box("Подождите", False) + get_counts() + stdscr.clear() + echo_selector() +finally: + curses.echo() + curses.curs_set(True) + stdscr.keypad(False) + curses.endwin() From 7cd9f76b78755809bf1bc3ce9190954d4bd07356 Mon Sep 17 00:00:00 2001 From: cthulhu <> Date: Thu, 18 Dec 2025 19:43:46 +0200 Subject: [PATCH 2/4] Fix: Crash on white theme (typo whie -> white) --- themes/white.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/white.cfg b/themes/white.cfg index 0af2ed1..5b5f7af 100644 --- a/themes/white.cfg +++ b/themes/white.cfg @@ -14,4 +14,4 @@ url blue white header red white statusline white cyan scrollbar cyan white -origin blue whie \ No newline at end of file +origin blue white From 6c2b70d11a09a49db1056685bf2f82439d69a547 Mon Sep 17 00:00:00 2001 From: cthulhu <> Date: Thu, 18 Dec 2025 20:00:11 +0200 Subject: [PATCH 3/4] Fix: Crash on long echo-title w truncate '...' --- caesium.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/caesium.py b/caesium.py index bda316a..9f7222a 100755 --- a/caesium.py +++ b/caesium.py @@ -432,6 +432,10 @@ def get_term_size(): height, width = stdscr.getmaxyx() def draw_title(y, x, title): + x = max(0, x) + if (x + len(title) + 2) > width: + title = title[:width - x - 2 - 3] + '...' + # if bold[0]: color = curses.color_pair(1) + curses.A_BOLD else: From 6537b83f741660a30967b68eba364f5f1f56ee7a Mon Sep 17 00:00:00 2001 From: cthulhu <> Date: Thu, 18 Dec 2025 19:48:27 +0200 Subject: [PATCH 4/4] Chore: .gitignore (.idea/, .venv/, ait/, lasts.lst) --- .gitignore | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.gitignore b/.gitignore index f809597..ac8437c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,8 @@ +.idea/ +.venv/ + +ait/ caesium.cfg idec.db __pycache__ +lasts.lst