$OpenBSD: patch-liboctave_oct-term_cc,v 1.1 2004/06/07 14:43:39 naddy Exp $ --- liboctave/oct-term.cc.orig 1996-03-03 02:16:15.000000000 +0100 +++ liboctave/oct-term.cc 2004-06-06 20:57:32.000000000 +0200 @@ -26,6 +26,10 @@ Software Foundation, 59 Temple Place - S #include "oct-term.h" +#if defined (USE_READLINE) +extern "C" int rl_get_screen_size(int *, int *); +#endif + // For now, use the variables from readline. It already handles // SIGWINCH, so these values have a good chance of being correct even // if the window changes size (they will be wrong if, for example, the @@ -36,7 +40,8 @@ int terminal_columns (void) { #if defined (USE_READLINE) - extern int screenwidth; + int screenheight, screenwidth; + rl_get_screen_size(&screenheight, &screenwidth); return screenwidth > 0 ? screenwidth : 80; #else // XXX FIXME XXX @@ -48,7 +53,8 @@ int terminal_rows (void) { #if defined (USE_READLINE) - extern int screenheight; + int screenheight, screenwidth; + rl_get_screen_size(&screenheight, &screenwidth); return screenheight > 0 ? screenheight : 24; #else // XXX FIXME XXX