From 337f3eaa6f2f2124f1551b0f52547f57313ccc09 Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Thu, 16 Jan 2020 14:16:09 -0500 Subject: Fixed some Windows terminal version issues and updated to PDCurses 3.9. `io.popen()` and `os.execute()` change the console mode such that mouse clicks are no longer detected. Make sure it's reset. Also prevent `os.execute()` output from overwriting the window. --- src/textadept.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/textadept.c') diff --git a/src/textadept.c b/src/textadept.c index c0bf836d..28e06ada 100644 --- a/src/textadept.c +++ b/src/textadept.c @@ -2504,6 +2504,9 @@ int main(int argc, char **argv) { sigaction(SIGWINCH, &act, NULL); #else freopen("NUL", "w", stderr); // redirect stderr +#if CURSES + freopen("NUL", "w", stdout); // redirect stdout +#endif #endif Scintilla *view = focused_view; @@ -2575,6 +2578,9 @@ int main(int argc, char **argv) { } else quit = FALSE; refresh_all(); view = !command_entry_focused ? focused_view : command_entry; +#if (_WIN32 && CURSES) + mouse_set(ALL_MOUSE_EVENTS); // _popen() and system() change console mode +#endif } endwin(); termkey_destroy(ta_tk); -- cgit v1.2.3