window: enable nonl and use raw terminal mode

This commit is contained in:
Andrzej Rybczak
2014-09-03 20:45:29 +02:00
parent 322baa5989
commit fb0b2158e3
3 changed files with 6 additions and 2 deletions

View File

@@ -152,6 +152,8 @@ int main(int argc, char **argv)
# ifndef WIN32 # ifndef WIN32
signal(SIGPIPE, sighandler); signal(SIGPIPE, sighandler);
signal(SIGWINCH, sighandler); signal(SIGWINCH, sighandler);
// ignore Ctrl-C
sigignore(SIGINT);
# endif // !WIN32 # endif // !WIN32
while (!Actions::ExitMainLoop) while (!Actions::ExitMainLoop)

View File

@@ -375,10 +375,12 @@ void initScreen(GNUC_UNUSED const char *window_title, bool enable_colors)
for (int j = 0; j < 8; ++j) for (int j = 0; j < 8; ++j)
init_pair(num++, ColorsTable[j], i < 0 ? i : ColorsTable[i]); init_pair(num++, ColorsTable[j], i < 0 ? i : ColorsTable[i]);
} }
raw();
nonl();
noecho(); noecho();
cbreak();
curs_set(0); curs_set(0);
rl_catch_signals = 0;
rl_initialize(); rl_initialize();
// disable autocompletion // disable autocompletion
rl_bind_key('\t', nullptr); rl_bind_key('\t', nullptr);

View File

@@ -89,7 +89,7 @@
// KEY_ENTER is 343, which doesn't make any sense. This makes it useful. // KEY_ENTER is 343, which doesn't make any sense. This makes it useful.
#undef KEY_ENTER #undef KEY_ENTER
#define KEY_ENTER 10 #define KEY_ENTER 13
// undefine scroll macro as it collides with Window::scroll // undefine scroll macro as it collides with Window::scroll
#undef scroll #undef scroll