# HG changeset patch # User John W. Eaton # Date 1559928489 14400 # Node ID af1015a3d558945f5802eee68040c124f3ff0faf # Parent e2061085dc5e720550e13b24c4b8991d0582fd94 allow terminal rows and columns to be set when not using readline * cmd-edit.h (command_editor::m_rows, command_editor::m_cols): New data members. (command_editor::command_editor): Initialized them to 24 and 80. (command_editor::do_terminal_rows): Return m_rows, not fixed value. (command_editor::do_terminal_cols): Return m_cols, not fixed value. (command_editor::do_set_screen_size): Set m_rows and m_cols. diff -r e2061085dc5e -r af1015a3d558 liboctave/util/cmd-edit.h --- a/liboctave/util/cmd-edit.h Fri Jun 07 15:52:51 2019 +0200 +++ b/liboctave/util/cmd-edit.h Fri Jun 07 13:28:09 2019 -0400 @@ -41,7 +41,9 @@ protected: command_editor (void) - : command_number (0), interrupted (false), initial_input () { } + : command_number (0), m_rows (24), m_cols (80), interrupted (false), + initial_input () + { } public: @@ -249,15 +251,19 @@ virtual void do_redisplay (void) { } - virtual int do_terminal_rows (void) { return 24; } + virtual int do_terminal_rows (void) { return m_rows; } - virtual int do_terminal_cols (void) { return 80; } + virtual int do_terminal_cols (void) { return m_cols; } virtual void do_clear_screen (bool) { } virtual void do_resize_terminal (void) { } - virtual void do_set_screen_size (int, int) { } + virtual void do_set_screen_size (int ht, int wd) + { + m_rows = ht; + m_cols = wd; + } virtual std::string do_decode_prompt_string (const std::string&); @@ -365,6 +371,9 @@ // The current command number. int command_number; + int m_rows; + int m_cols; + bool interrupted; std::string initial_input;