>From f80558a9b708e08f3a9fc1b0c1aed65b1a43282d Mon Sep 17 00:00:00 2001 From: Andreas Amann Date: Tue, 25 Feb 2014 21:28:44 +0000 Subject: [PATCH] Fix emacsclient's behavior when started in background * emacsclient.c (main): raise SIGSTOP if emacsclient process is started in the background in tty mode. --- lib-src/ChangeLog | 2 ++ lib-src/emacsclient.c | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog index bd0a16e..cf367ab 100644 --- a/lib-src/ChangeLog +++ b/lib-src/ChangeLog @@ -2,6 +2,8 @@ Fix emacsclient's handling of SIGCONT (Bug#16883). * emacsclient.c (handle_sigcont): Cancel the continue only if tty. + (main): raise SIGSTOP if emacsclient process is started in the + background in tty mode. 2014-01-22 Eli Zaretskii diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c index 148182a..7bed240 100644 --- a/lib-src/emacsclient.c +++ b/lib-src/emacsclient.c @@ -1554,6 +1554,13 @@ main (int argc, char **argv) exit (EXIT_FAILURE); } +#if !defined (NO_SOCKETS_IN_FILE_SYSTEM) + if (tcgetpgrp (1) != getpgrp () && tty) + { + raise(SIGSTOP); + } +#endif /* NO_SOCKETS_IN_FILE_SYSTEM */ + /* If alternate_editor is the empty string, start the emacs daemon in case of failure to connect. */ start_daemon_if_needed = (alternate_editor -- 1.9.0