lynx-dev
[Top][All Lists]
Advanced

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

LYNX-DEV Control-Z and SIGSTOP mysteries


From: Klaus Weide
Subject: LYNX-DEV Control-Z and SIGSTOP mysteries
Date: Sat, 17 May 1997 19:53:27 -0500 (CDT)

Thanks to one of John Davis's patches (now in fotemods and devel 0.24),
one can now not only suspend Lynx during connection establishment (the
"waiting for response" phase, and when resumed with fg it will continue
at that point.  (So it's more than just display and command key glitches).
(I have only tried with slang on solaris so far.)

Ok, that encouraged me to look at the suspend issues more closely.
I am sure some unix guru (from the east or west coast or anywhere else)
would be more qualified...

Here's one problem:  do something that invoke a child process which
can be suspended with ^Z.  For example, I have a PRINTER: which displays
the file with a shell command which invokes `less'.  While in less,
I can suspend with ^Z.  When I fg, both processes come alive (less and
lynx) and compete for the display and keyboard, which is a bit confusing
to say the least...  This happens with curses, ncurses, and slang.

I am experimenting with a LYSystem() wrapper to be used instead of
system(), which changes signal(SIGTSTP,...) before calling system().
This is of course only for unix - there already is something similar
for VMS.  But there should be a better way than this - how do other
programs which use system() deal with it?

Second problem: suspending a lynx process started from a shell script
(for example, the wrapper script I posted a while ago) sometimes acts 
differently from suspending a lynx which was directly invoked from the
shell command line.  It seems that the lynx process which is a direct
child of the interactive shell always gets a SIGTSTP signal.  The indirect
child process sometimes seems to get a SIGSTOP (in addition to the
SIGTSTP??).  With slang the process then stops without the usual
resetting of the screen (color is left on, cursor may be in the middle 
of the screen), because the SIGTSTP handler is not called.  Sometimes the
SIGSTOP results in lynx being exited when it gets to CONTinue (The shell
gets 128+SIGSTOP in $?). This happens especially when there are printf()s 
to stderr for debugging in sl_suspend (maybe shouldn't do stdio in a signal 
handler...) but sometimes also otherwise.

Any clues welcome.  For example why does SIGSTOP followed by SIGCONT
terminate the process??

How slang (with lynx) tries to deal with SIGTSTP is visible in LYCurses.c.
How does it work with ncurses?

Of course all this is likely very system dependent.  But I have
found similar behavior on solaris and linux, with solaris sh and various
bash shells on linux.

   Klaus



;
; To UNSUBSCRIBE:  Send a mail message to address@hidden
;                  with "unsubscribe lynx-dev" (without the
;                  quotation marks) on a line by itself.
;

reply via email to

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