Mercurial > mxe-octave
view src/readline-1-sigwinch.patch @ 4590:5b5c47cd2111
Add file with hg id of MXE-Octave to dist package (bug #52794).
* tools/mk-hg-id.sh: New file copied (mostly) from Octave sources.
* Makefile.in: Call shell script, copy HG-ID in make dist
* binary-dist-rules.mk: Copy HG-ID to dist directory.
* dist-files.mk: add mk-hg-id.sh to dist files
author | Markus Mützel <markus.muetzel@gmx.de> |
---|---|
date | Wed, 03 Jan 2018 14:18:12 +0100 |
parents | 2cf09b449d88 |
children |
line wrap: on
line source
diff -uNr a/readline.c b/readline.c --- a/readline.c 2010-07-25 17:07:40.000000000 -0400 +++ b/readline.c 2013-04-17 16:11:52.932653458 -0400 @@ -970,6 +970,11 @@ rl_initialized++; RL_SETSTATE(RL_STATE_INITIALIZED); } +#if defined (__MINGW32__) + else + /* In case the console window has been resized outside of readline */ + rl_reset_screen_size (); +#endif /* Initalize the current line information. */ _rl_init_line_state (); diff -uNr a/signals.c b/signals.c --- a/signals.c 2011-02-11 10:53:33.000000000 -0500 +++ b/signals.c 2013-04-17 16:07:57.476121748 -0400 @@ -46,6 +46,11 @@ #include "rlprivate.h" +#if defined (__MINGW32__) +# define WIN32_LEAN_AND_MEAN +# include <windows.h> +#endif + #if defined (HANDLE_SIGNALS) #if !defined (RETSIGTYPE) @@ -91,7 +96,7 @@ int rl_catch_signals = 1; /* If non-zero, readline will install a signal handler for SIGWINCH. */ -#ifdef SIGWINCH +#if defined (SIGWINCH) || defined (__MINGW32__) int rl_catch_sigwinch = 1; #else int rl_catch_sigwinch = 0; /* for the readline state struct in readline.c */ @@ -422,6 +427,21 @@ } #endif /* SIGWINCH */ +#if defined (__MINGW32__) + if (rl_catch_sigwinch && sigwinch_set_flag == 0) + { + DWORD mode; + HANDLE hStdIn = GetStdHandle (STD_INPUT_HANDLE); + + if (GetConsoleMode (hStdIn, &mode)) + { + mode |= ENABLE_WINDOW_INPUT; + if (SetConsoleMode (hStdIn, mode)) + sigwinch_set_flag = 1; + } + } +#endif + return 0; } @@ -467,6 +487,21 @@ } #endif +#if defined (__MINGW32__) + if (rl_catch_sigwinch && sigwinch_set_flag == 1) + { + DWORD mode; + HANDLE hStdIn = GetStdHandle (STD_INPUT_HANDLE); + + if (GetConsoleMode (hStdIn, &mode)) + { + mode &= ~ENABLE_WINDOW_INPUT; + if (SetConsoleMode (hStdIn, mode)) + sigwinch_set_flag = 0; + } + } +#endif + return 0; }