}
/* taken from mutt */
-static char *km_keyname(int c)
+static const char *km_keyname(int c)
{
static char buf[10];
switch (ret) {
case SIGTERM:
die(EXIT_FAILURE, "only the good die young (caught SIGTERM)\n");
+ case SIGWINCH:
+ PARA_NOTICE_LOG("got SIGWINCH\n");
+ if (curses_active()) {
+ shutdown_curses();
+ init_curses();
+ redraw_bot_win();
+ }
+ return 1;
case SIGINT:
return 1;
case SIGUSR1:
{
int i;
const struct lls_opt_result *lor = OPT_RESULT(KEY_MAP);
+ const char *keyname = km_keyname(c);
/* first check user-defined key bindings */
FOR_EACH_KEY_MAP(i) {
free(tmp);
return;
}
- if (strcmp(tmp, km_keyname(c))) {
+ if (strcmp(tmp, keyname)) {
free(tmp);
continue;
}
}
/* not found, check internal key bindings */
for (i = 0; command_list[i].handler; i++) {
- if (!strcmp(km_keyname(c), command_list[i].key)) {
+ if (!strcmp(keyname, command_list[i].key)) {
command_list[i].handler();
return;
}
}
print_in_bar(COLOR_ERRMSG, "key '%s' is not bound, press ? for help",
- km_keyname(c));
+ keyname);
}
static int input_post_select(__a_unused struct sched *s,
ret = wgetch(top.win);
if (ret == ERR)
return 0;
- if (ret == KEY_RESIZE) {
- if (curses_active()) {
- shutdown_curses();
- init_curses();
- redraw_bot_win();
- }
+ if (ret == KEY_RESIZE) /* already handled in signal_post_select() */
return 0;
- }
if (exs == EXEC_IDLE)
handle_command(ret);
else if (exec_pid > 0)
para_install_sighandler(SIGTERM);
para_install_sighandler(SIGCHLD);
para_install_sighandler(SIGUSR1);
+ para_install_sighandler(SIGWINCH);
signal_task->task = task_register(&(struct task_info) {
.name = "signal",
.pre_select = signal_pre_select,