^Z can't suspend less in the tty mode

Fifer, Eric EFifer@sanwaint.com
Tue May 9 02:42:00 GMT 2000

>This is a long standing problem. ^Z can't suspend the `less'
>command in the tty mode.

This has been annoying me too ...

What is happening is that when SIGTSTP is caught the signal
handler does a longjmp().  And, when the thread restarts at the
setjmp() the signal mask is not restored.  This is a patch against
less-354 (from http://home.flash.net/~marknu/less/ ) which fixes
the problem:

--- os.c-	Mon Mar 06 11:58:01 2000
+++ os.c	Mon Mar 06 12:21:46 2000
@@ -99,6 +99,7 @@ iread(fd, buf, len)
 		 * We jumped here from intread.
 		reading = 0;
+		{ sigset_t mask = 0; sigprocmask(SIG_SETMASK, &mask, NULL);

I'll send a more complete patch to the author ...

Eric Fifer

More information about the Cygwin-developers mailing list