From 291a28d994bb36e44166ff07556a70cd1f1a5232 Mon Sep 17 00:00:00 2001 From: h8d13 Date: Mon, 29 Dec 2025 18:16:55 +0100 Subject: [PATCH] Aims to fix #3814 by setting max x and try block --- archinstall/tui/curses_menu.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/archinstall/tui/curses_menu.py b/archinstall/tui/curses_menu.py index d1ab11e188..c8c9950254 100644 --- a/archinstall/tui/curses_menu.py +++ b/archinstall/tui/curses_menu.py @@ -371,7 +371,15 @@ def edit(self, default_text: str | None = None) -> None: self._edit_win.erase() if default_text is not None and len(default_text) > 0: - self._edit_win.addstr(0, 0, default_text) + # Get the window width to avoid overflow + _, max_x = self._edit_win.getmaxyx() + # Truncate text to fit within window width + display_text = default_text[:max_x] + try: + self._edit_win.addstr(0, 0, display_text) + except curses.error: + # If addstr still fails (edge case), just skip displaying default text + pass # if this gets initialized multiple times it will be an overlay # and ENTER has to be pressed multiple times to accept