diff options
author | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2013-01-19 11:51:56 +0100 |
---|---|---|
committer | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2013-01-19 11:51:56 +0100 |
commit | 72b948fb1eaba1fc06de7325cc095f0889ce4d7f (patch) | |
tree | 4f53e793ddda10ca4ddcff9355a5c51953a389e6 /src/interface-ncurses.cpp | |
parent | a54b49f5a8858ae6603d0db56019adc3ce0dff90 (diff) | |
download | sciteco-72b948fb1eaba1fc06de7325cc095f0889ce4d7f.tar.gz |
allow <CTRL/C> to be typed; aborts last typed char
* CTRL/C will be a command so it is important to be able to type it directly
* aborting character processing is important because it allows aborting infinite loops
* since the loop interruption currently relies on SIGINT handling, there is only limited
support for XCurses and GTK - CTRL/C has to be typed in the terminal window.
later support for input queue polling might be added
Diffstat (limited to 'src/interface-ncurses.cpp')
-rw-r--r-- | src/interface-ncurses.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/interface-ncurses.cpp b/src/interface-ncurses.cpp index 97c050d..98f2dca 100644 --- a/src/interface-ncurses.cpp +++ b/src/interface-ncurses.cpp @@ -43,7 +43,7 @@ InterfaceNCurses interface; extern "C" { static void scintilla_notify(Scintilla *sci, int idFrom, - void *notify, void *user_data); + void *notify, void *user_data); } #define UNNAMED_FILE "(Unnamed)" @@ -63,7 +63,6 @@ static void scintilla_notify(Scintilla *sci, int idFrom, InterfaceNCurses::InterfaceNCurses() { init_screen(); - raw(); cbreak(); noecho(); curs_set(0); /* Scintilla draws its own cursor */ @@ -368,7 +367,12 @@ InterfaceNCurses::event_loop(void) if (popup.window) wrefresh(popup.window); + /* no special <CTRL/C> handling */ + raw(); key = wgetch(cmdline_window); + /* allow asynchronous interruptions on <CTRL/C> */ + cbreak(); + switch (key) { #ifdef KEY_RESIZE case ERR: @@ -403,6 +407,8 @@ InterfaceNCurses::event_loop(void) if (key <= 0xFF) cmdline_keypress((gchar)key); } + + sigint_occurred = FALSE; } } |