window: enable nonl and use raw terminal mode
This commit is contained in:
@@ -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)
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user