On 4/13/23 16:17, Tom de Vries via Gdb-patches wrote: > On 4/13/23 16:08, Tom de Vries via Gdb-patches wrote: >> @@ -1144,6 +1148,11 @@ init_page_info (void) >>         /* Get the screen size from Readline.  */ >>         rl_get_screen_size (&rows, &cols); >> +      if (gdb_stdout->isatty ()) { >> +    readline_hidden_cols = COLS - cols; >> +    gdb_assert (readline_hidden_cols >= 0); >> +    gdb_assert (readline_hidden_cols <= 1); >> +      } >>         lines_per_page = rows; >>         chars_per_line = cols; > > Reading this over once more, I noticed this is missing a fix for an > assertion failure we run into when doing: > ... > $ TERM=blabla gdb > ... > > So, this bit is missing: > ... > -      if (gdb_stdout->isatty ()) { > +      if (gdb_stdout->isatty () && COLS != 0) { > ... > I also ran into trouble with this version. It's not a good idea to use COLS, because it's just a copy of the env variable COLUMNS at the time of curses startup. So, I can trigger one of the asserts by doing: ... $ COLUMNS= gdb ... Here's an updated version, using the COLUMNS value as written by readline instead. Thanks, - Tom