Subject: Re: bug#13387: emacsclient -t suspends emacs

From: Dan Nicolaescu <[email-masked]>
Date: Thu, 10 Jan 2013 02:04:25 -0500

Dan Nicolaescu <[email-masked]> writes:

> With the current trunk:
>
> emacs -Q &
> M-x server-start RET
> and  from the same terminal do:
> emacsclient -t
>
> This results in:
> [1]  + Suspended (tty output)        emacs -Q
>
> This is a regression, it works just fine in 24.1

The commit that caused this is 110801.

This hunk looks suspicious:

@@ -1286,11 +1282,7 @@ child_setup (int in, int out, int err, c
   if (err != in && err != out)
     emacs_close (err);

-#if defined HAVE_SETPGID || ! (defined USG && defined SETPGRP_RELEASES_CTTY)
-  setpgid (pid, pid);
-#endif
-
-  /* setpgrp_of_tty is incorrect here; it uses input_fd.  */
+  setpgid (0, 0);
   tcsetpgrp (0, pid);
 
   /* execvp does not accept an environment arg so the only way

it replaces setpgid (pid, pid) with setpgid (0, 0) on GNU/Linux.