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