diff libinterp/corefcn/sysdep.cc @ 19494:37159a873c96 gui-release

preserve text on Windows terminal resize (bug #41893; patch #8532) * QWinTerminalImpl.h, QWinTerminalImpl.cpp (QConsolePrivate::updateConsoleSize): Don't shrink the size of the console buffer. Store the terminal size in the environment. Force the command line editor (usually readline) to notice the change in screen size as soon as possible. (QWinTerminalImpl::QWinTerminalImpl): Connect set_screen_size_signal with parent set_screen_size slot. (QWinTerminalImpl::set_screen_size_signal): New signal. * main-window.h, main-window.cc (main_window::int_pair): New typedef. (main_window::set_screen_size_callback): New callback function. (main_window::set_screen_size): New slot. * sysdep.cc (w32_init): New function. Tell command_editor to prefer environment variables for window size. (MINGW_init, MSVC_init): Call w32_init. (QWinTerminalImpl::setSize): Emit set_screen_size_signal.
author John W. Eaton <jwe@octave.org>
date Thu, 09 Oct 2014 19:20:56 -0400
parents 7bccc182e2f7
children 912158cf524d
line wrap: on
line diff
--- a/libinterp/corefcn/sysdep.cc
+++ b/libinterp/corefcn/sysdep.cc
@@ -169,13 +169,21 @@
 {
   w32_set_quiet_shutdown ();
 }
+
+static void
+w32_init (void)
+{
+  w32_set_octave_home ();
+
+  command_editor::prefer_env_winsize (true);
+}
 #endif
 
 #if defined (__MINGW32__)
 static void
 MINGW_init (void)
 {
-  w32_set_octave_home ();
+  w32_init ();
 }
 #endif
 
@@ -183,7 +191,7 @@
 static void
 MSVC_init (void)
 {
-  w32_set_octave_home ();
+  w32_init ();
 }
 #endif