bug-ncurses
[Top][All Lists]
Advanced

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

Re: Resizing terminal raises additional signal


From: Thomas Dickey
Subject: Re: Resizing terminal raises additional signal
Date: Sat, 31 Jan 2015 19:33:21 -0500
User-agent: Mutt/1.5.20 (2009-06-14)

On Thu, Jan 29, 2015 at 10:35:33PM +0100, vcoxvco wrote:
> Hi,
> 
> I'm facing a strange problem in conjunction with SIGWINCH on
> Windows/Cygwin.
> 
> 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.

SIGUSR1 is signal 18.

ncurses doesn't use that (except in the test-program).

> 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.

ncurses does establish signal handlers - and doesn't turn them off,
except while doing a screen update.  But I don't have any ideas how
that could affect SIGUSR1.
 
> I also patched and built ncurses with and without "SIGTSTP" support -
> no difference in behaviour.

But of course, there are also handlers for SIGWINCH, SIGINT and SIGTERM.
SIGTSTP is a special case due to the way it interacts with other programs.
Disabling the whole _nc_signal_handler() function might provide some
additional insight - at least, to see if the signal handlers are the issue,
or some other function such as nanosleep() is related.
 
> Any idea why this happens (and is this really an ncurses problem or
> rather something specific to Cygwin)?

It sounds as if it is Cygwin-specific.

-- 
Thomas E. Dickey <address@hidden>
http://invisible-island.net
ftp://invisible-island.net

Attachment: signature.asc
Description: Digital signature


reply via email to

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