From 4dced2c9d230b88e910e46a78e3e559792520ae1 Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Thu, 12 Mar 2015 04:19:11 +0100 Subject: improved ncurses batch mode initialization * I now understand better why the old initialization worked ;-) By not calling initscr(), we could prevent some terminal setup and screen clearing usually performed which would interfere with with having a clean stdout stream. However the Curses screen was still basically attached to the terminal. * That's why there was screen flickering in urxvt when calling sciteco (even in batch mode). Also that's why calling batch-mode SciTECO did not work from other Curses programs (including SciTECO). * The new implementation directs Curses at /dev/null, so it will completely stay away from /dev/tty. * /dev/tty is associated with the Curses screen only when the interactive mode is initialized. This works elegantly via freopen() - there's no need to create a new Curses screen. * This does currently not work on PDCurses where the batch mode will still initscr() followed by endwin(). I should investigate how newterm() behaves there - especially on Windows. --- src/interface-curses.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/interface-curses.h') diff --git a/src/interface-curses.h b/src/interface-curses.h index 2a83bcc..5da7e56 100644 --- a/src/interface-curses.h +++ b/src/interface-curses.h @@ -147,7 +147,9 @@ public: void event_loop_impl(void); private: - void init_screen(void); + void init_batch(void); + void init_interactive(void); + void resize_all_windows(void); void draw_info(void); -- cgit v1.2.3