[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Resizing terminal raises additional signal

From: vcoxvco
Subject: Resizing terminal raises additional signal
Date: Thu, 29 Jan 2015 22:35:33 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0


I'm facing a strange problem in conjunction with SIGWINCH on

When resizing a terminal (in this case MinTTY), KEY_RESIZE is correctly
put into ncurses' queue (i.e. SIGWINCH is handled as expected), but it
seems that there is also another signal (18 according to strace) that
is raised in this case.
The effect is that a call to e.g. system() returns when resizing a
terminal while being inside system().

The code below demonstrates this behaviour:
Open 2 terminals and in one call "./sys 2> xx" (vi will open)
in the other one call "tail -f xx"
Then resize the 1st Window and you will see that system() terminates
(i.e. "done" is written on 2nd terminal)
It makes no difference whether endwin() is called before or after
system(), it's sufficient that curses has been initialized.

This code works as expected with ncurses/xterm on Linux (openSUSE) and
it also works on Windows/Cygwin when *not* calling initscr()/endwin(),
so I guess there is a relation to ncurses.

I also patched and built ncurses with and without "SIGTSTP" support -
no difference in behaviour.

Any idea why this happens (and is this really an ncurses problem or
rather something specific to Cygwin)?


--- 8< ---

#include <stdio.h>
#include <stdlib.h>
#include <curses.h>

int main()
        fprintf(stderr, "calling system()\n");
        /* This may also be "read" instead of "vi zz" */
        system("vi zz");
        fprintf(stderr, "done\n");

sys:    sys.c Makefile
        gcc sys.c -o sys -lncurses

V. Courzakis
email: address@hidden

reply via email to

[Prev in Thread] Current Thread [Next in Thread]