From 8101cec729c07fd5bdeda70c12dbb43a2383cbe8 Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Thu, 18 Jun 2015 16:24:32 +0200 Subject: major Curses UI revision: initialize curses as late as possible * relies on a patched version of Scinterm that allows you to construct Scintilla objects, send messages etc. before Curses is initialized. The Scintilla and Scinterm submodules have been updated. * This once and for all fixes batch mode and stdio redirections in batch mode on all Curses platforms and operating systems. * Fixes the ^C-does-not-interrupt bug on ncurses/UNIX. See #4. * On ncurses/UNIX we will still do a newterm()-initialization. This allows us to keep stdout/stderr alone in case they are redirected. This effectively allows redirecting SciTECO's output into a file even in interactive mode. ncurses/UNIX now behaves like, e.g. PDCurses/win32a and GTK+ in this regard. * Curses environment variable handling fixed. The environment registers are exported into the process environment so that Curses environment variables can be set/modified by the SciTECO profile. * Use term.h for accessing terminfo now. Explained set_window_title() limitations. * fixed interruption via SIGINT. If the UI is waiting for user input, SIGINT is effectively ignored instead of letting the next character fail always. * Updated sciteco(1) and sciteco(7): More options, environment variables and signals documented. Also rewritten DESCRIPTION section (different modes of operation). --- src/interface-curses.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/interface-curses.h') diff --git a/src/interface-curses.h b/src/interface-curses.h index 971d2fa..471b462 100644 --- a/src/interface-curses.h +++ b/src/interface-curses.h @@ -44,8 +44,8 @@ public: { /* * NOTE: This deletes/frees the view's - * curses WINDOW, despite of what Scinterm's - * documentation says. + * curses WINDOW, despite of what old versions + * of the Scinterm documentation claim. */ if (sci) scintilla_delete(sci); @@ -72,6 +72,7 @@ public: } ViewCurrent; typedef class InterfaceCurses : public Interface { + int stdout_orig, stderr_orig; SCREEN *screen; FILE *screen_tty; @@ -100,7 +101,8 @@ typedef class InterfaceCurses : public Interface { } popup; public: - InterfaceCurses() : screen(NULL), + InterfaceCurses() : stdout_orig(-1), stderr_orig(-1), + screen(NULL), screen_tty(NULL), info_window(NULL), info_current(NULL), @@ -146,8 +148,9 @@ public: void event_loop_impl(void); private: - void init_batch(void); + void init_screen(void); void init_interactive(void); + void restore_batch(void); void resize_all_windows(void); -- cgit v1.2.3