From unknown Sun Jun 22 11:31:07 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#16883 <16883@debbugs.gnu.org> To: bug#16883 <16883@debbugs.gnu.org> Subject: Status: [PATCH] Fix emacsclient's handling of SIGCONT. Reply-To: bug#16883 <16883@debbugs.gnu.org> Date: Sun, 22 Jun 2025 18:31:07 +0000 retitle 16883 [PATCH] Fix emacsclient's handling of SIGCONT. reassign 16883 emacs submitter 16883 Andreas Amann severity 16883 normal tag 16883 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Tue Feb 25 13:46:36 2014 Received: (at quiet) by debbugs.gnu.org; 25 Feb 2014 18:46:36 +0000 Received: from localhost ([127.0.0.1]:39794 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WIN1X-0001Ci-Fp for submit@debbugs.gnu.org; Tue, 25 Feb 2014 13:46:36 -0500 Received: from fencepost.gnu.org ([208.118.235.10]:52383 ident=Debian-exim) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WIN0A-00019q-5C for quiet@debbugs.gnu.org; Tue, 25 Feb 2014 13:45:10 -0500 Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1WIN09-0001DI-VD for quiet@debbugs.gnu.org; Tue, 25 Feb 2014 13:45:09 -0500 From: Andreas Amann To: quiet@debbugs.gnu.org Subject: [PATCH] Fix emacsclient's handling of SIGCONT. Date: Thu, 20 Feb 2014 00:05:30 +0000 Lines: 73 (x86_64-unknown-linux-gnu) X-From-Line: emacs-devel-bounces+rgm=gnu.org@gnu.org Wed Feb 19 19:46:28 2014 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43575) by fencepost.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1WGHmV-0001Tu-VV for rgm@gnu.org; Wed, 19 Feb 2014 19:46:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WGHmP-0001BB-Dg for rgm@gnu.org; Wed, 19 Feb 2014 19:46:27 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: ** X-Spam-Status: No, score=2.7 required=5.0 tests=BAYES_50, RECEIVED_FROM_WINDOWS_HOST,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:37787) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WGHmP-0001B7-BV for rgm@gnu.org; Wed, 19 Feb 2014 19:46:21 -0500 Received: from localhost ([::1]:34759 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WGHmP-00038r-8f for rgm@gnu.org; Wed, 19 Feb 2014 19:46:21 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43631) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WGHNh-0000rN-CE for emacs-devel@gnu.org; Wed, 19 Feb 2014 19:20:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WGHNb-0002qq-Qc for emacs-devel@gnu.org; Wed, 19 Feb 2014 19:20:49 -0500 Received: from va3ehsobe010.messaging.microsoft.com ([216.32.180.30]:8100 helo=va3outboundpool.messaging.microsoft.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WGHNb-0002ql-M9 for emacs-devel@gnu.org; Wed, 19 Feb 2014 19:20:43 -0500 Received: from mail135-va3-R.bigfish.com (10.7.14.245) by VA3EHSOBE011.bigfish.com (10.7.40.61) with Microsoft SMTP Server id 14.1.225.22; Thu, 20 Feb 2014 00:05:39 +0000 Received: from mail135-va3 (localhost [127.0.0.1]) by mail135-va3-R.bigfish.com (Postfix) with ESMTP id F16E9400255 for ; Thu, 20 Feb 2014 00:05:38 +0000 (UTC) X-Forefront-Antispam-Report: CIP:143.239.1.23; KIP:(null); UIP:(null); IPV:NLI; H:mail3.ucc.ie; RD:mail3.ucc.ie; EFVD:NLI X-SpamScore: -1 X-BigFish: VPS-1(zz936eI154dIzz1f42h2148h208ch1ee6h1de0h1d18h1fdah2073h2146h1202h1e76h2189h1d1ah1d2ah21bch1fc6hzz1de098h8275dh1de097hz2fh2a8h839hd24he5bhf0ahfa3h107ah11b5h121eh1288h12a5h12a9h12bdh12e5h137ah13b6h1441h14afh1504h1537h153bh162dh1631h1758h18e1h1946h19b5h1b0ah224fh1d0ch1d2eh1d3fh1dc1h1dfeh1dffh1e1dh1fe8h1ff5h209eh2216h22d0h2336h2438h2461h2487h24d7h2516h2545h255eh2388i1155h) Received-SPF: pass (mail135-va3: domain of ucc.ie designates 143.239.1.23 as permitted sender) client-ip=143.239.1.23; envelope-from=a.amann@ucc.ie; helo=mail3.ucc.ie ; mail3.ucc.ie ; Received: from mail135-va3 (localhost.localdomain [127.0.0.1]) by mail135-va3 (MessageSwitch) id 1392854736312503_27271; Thu, 20 Feb 2014 00:05:36 +0000 (UTC) Received: from VA3EHSMHS016.bigfish.com (unknown [10.7.14.230]) by mail135-va3.bigfish.com (Postfix) with ESMTP id 3A7184C0047 for ; Thu, 20 Feb 2014 00:05:36 +0000 (UTC) Received: from mail3.ucc.ie (143.239.1.23) by VA3EHSMHS016.bigfish.com (10.7.99.26) with Microsoft SMTP Server (TLS) id 14.16.227.3; Thu, 20 Feb 2014 00:05:32 +0000 Received: from msstf091.ucc.ie (msstf091.ucc.ie [143.239.76.91]) by mail3.ucc.ie (8.14.4/8.14.4) with ESMTP id s1K05U0I003245 for ; Thu, 20 Feb 2014 00:05:30 GMT Received: by msstf091.ucc.ie (Postfix, from userid 1000) id 8BAA1A2DA3; Thu, 20 Feb 2014 00:05:30 +0000 (GMT) X-OriginatorOrg: ucc.ie X-FOPE-CONNECTOR: Id%0$Dn%*$RO%0$TLS%0$FQDN%$TlsDn% X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 X-Mailman-Approved-At: Wed, 19 Feb 2014 19:46:14 -0500 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 Message-ID: User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: quiet X-Mailman-Approved-At: Tue, 25 Feb 2014 13:46:33 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) Package: emacs Version: 24.3 [ Resent from http://lists.gnu.org/archive/html/emacs-devel/2014-02/msg00467.html ] * emacsclient.c (handle_sigcont): previously it was not possible to run emacsclient in the background using "bg", because SIGCONT was blocked in this case. Now SIGCONT is only blocked if the Emacs frame is opened on the current terminal. --- There is an annoying problem with backgrounding of emacsclient processes. To illustrate the problem, do the following: >emacs -Q -f server-start & [1] xxxPID1xxx >emacsclient -c filename Waiting for Emacs...^Z (press control-z) [2]+ Stopped emacsclient -c filename >bg [2]+ emacsclient -c ~/.bashrc & [2]+ Stopped emacsclient -c ~/.bashrc At this point, emacsclient is stopped and not running in the background as it should after receiving the SIGCONT signal through "bg". We can still go to the second emacs frame showing "filename", finish editing the file and leave the frame with C-x #. After this, the emacsclient is stalled in the "Stopped" state, and does not exit as it should. It will only exit after issuing >fg The attached patch fixes this by only stopping emacsclient, if the emacs frame is opened in the current terminal. lib-src/ChangeLog | 8 ++++++++ lib-src/emacsclient.c | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog index 5005e1f..1c2862f 100644 --- a/lib-src/ChangeLog +++ b/lib-src/ChangeLog @@ -1,3 +1,11 @@ +2014-02-19 Andreas Amann + + Fix emacsclient's handling of SIGCONT. + * emacsclient.c (handle_sigcont): previously it was not possible + to run emacsclient in the background using "bg", because SIGCONT + was blocked in this case. Now SIGCONT is only blocked if the + Emacs frame is opened on the current terminal. + 2014-01-22 Eli Zaretskii * update-game-score.c (write_scores) [WINDOWSNT]: Use chmod diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c index 6593b91..fd85a50 100644 --- a/lib-src/emacsclient.c +++ b/lib-src/emacsclient.c @@ -1111,7 +1111,7 @@ handle_sigcont (int signalnum) /* We are in the foreground. */ send_to_emacs (emacs_socket, "-resume \n"); } - else + else if (tty) { /* We are in the background; cancel the continue. */ raise (SIGSTOP); -- 1.8.5.4 From debbugs-submit-bounces@debbugs.gnu.org Tue Feb 25 14:07:56 2014 Received: (at 16883-done) by debbugs.gnu.org; 25 Feb 2014 19:07:56 +0000 Received: from localhost ([127.0.0.1]:39820 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WINMC-0001nl-4f for submit@debbugs.gnu.org; Tue, 25 Feb 2014 14:07:56 -0500 Received: from smtp.cs.ucla.edu ([131.179.128.62]:36804) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WINM9-0001nU-Pj for 16883-done@debbugs.gnu.org; Tue, 25 Feb 2014 14:07:54 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id 23F1F39E8011; Tue, 25 Feb 2014 11:07:48 -0800 (PST) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ZGBUdl2dozIZ; Tue, 25 Feb 2014 11:07:47 -0800 (PST) Received: from penguin.cs.ucla.edu (Penguin.CS.UCLA.EDU [131.179.64.200]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id CE6EA39E8008; Tue, 25 Feb 2014 11:07:47 -0800 (PST) Message-ID: <530CEA03.30301@cs.ucla.edu> Date: Tue, 25 Feb 2014 11:07:47 -0800 From: Paul Eggert Organization: UCLA Computer Science Department User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 MIME-Version: 1.0 To: a.amann@ucc.ie, 16883-done@debbugs.gnu.org Subject: Re: [PATCH] Fix emacsclient's handling of SIGCONT. References: <87r46y8x85.fsf@msstf091.ucc.ie> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 16883-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) Thanks for the bug report. I applied that change as part of Emacs trunk bzr 116558. From unknown Sun Jun 22 11:31:07 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Wed, 26 Mar 2014 11:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator