Qingning Huo <[EMAIL PROTECTED]> writes:

> So what is the real reason of this bug, elinks
> is somehow confused whether it is at foreground?

The reason is that "fg" in Bash nowadays does not send SIGCONT to
the job if Bash has seen from waitpid() that the job is already
running.  ELinks expects to receive this SIGCONT, in order to
know when it should try to take control of the terminal again.

This worked correctly in Bash 2.05 but has been broken since 2.05a.
The following patch does not revert any change between 2.05 and 2.05a
but fixes or works around the bug anyway.

diff -up /var/tmp/Kalle/Debian/bash-3.1dfsg/bash/jobs.c.\~1\~ 
/var/tmp/Kalle/Debian/bash-3.1dfsg/bash/jobs.c
--- /var/tmp/Kalle/Debian/bash-3.1dfsg/bash/jobs.c.~1~  2008-01-23 
00:16:33.000000000 +0200
+++ /var/tmp/Kalle/Debian/bash-3.1dfsg/bash/jobs.c      2008-01-23 
00:17:55.000000000 +0200
@@ -2754,8 +2754,7 @@ start_job (job, foreground)
   else
     jobs[job]->flags &= ~J_FOREGROUND;
 
-  /* If the job is already running, then don't bother jump-starting it. */
-  if (already_running == 0)
+  if (1)
     {
       jobs[job]->flags |= J_NOTIFIED;
       killpg (jobs[job]->pgrp, SIGCONT);

Attachment: pgpIG1btv7Zeo.pgp
Description: PGP signature

_______________________________________________
elinks-dev mailing list
elinks-dev@linuxfromscratch.org
http://linuxfromscratch.org/mailman/listinfo/elinks-dev

Reply via email to