aboutsummaryrefslogtreecommitdiff
path: root/src/textadept.c
diff options
context:
space:
mode:
authormitchell <70453897+667e-11@users.noreply.github.com>2020-01-16 14:16:09 -0500
committermitchell <70453897+667e-11@users.noreply.github.com>2020-01-16 14:16:09 -0500
commit337f3eaa6f2f2124f1551b0f52547f57313ccc09 (patch)
tree1ef9e91c92ed9fceee08bccea41d76d33b86d1bc /src/textadept.c
parent8543925dd9cec8e2e5e39a54b4416b450463f4d1 (diff)
downloadtextadept-337f3eaa6f2f2124f1551b0f52547f57313ccc09.tar.gz
textadept-337f3eaa6f2f2124f1551b0f52547f57313ccc09.zip
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.
Diffstat (limited to 'src/textadept.c')
-rw-r--r--src/textadept.c6
1 files changed, 6 insertions, 0 deletions
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);