GNU bug report logs - #16892
24.3; terminal corruption after emacsclient -t &

Previous Next

Package: emacs;

Reported by: <a.amann <at> ucc.ie>

Date: Thu, 27 Feb 2014 13:52:02 UTC

Severity: normal

Tags: patch

Found in version 24.3

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 16892 in the body.
You can then email your comments to 16892 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#16892; Package emacs. (Thu, 27 Feb 2014 13:52:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to <a.amann <at> ucc.ie>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 27 Feb 2014 13:52:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: <a.amann <at> ucc.ie>
To: <bug-gnu-emacs <at> gnu.org>
Subject: 24.3; terminal corruption after emacsclient -t &
Date: Thu, 27 Feb 2014 13:50:22 +0000
[Message part 1 (text/plain, inline)]
after doing:

emacs -Q -f server-start&
emacsclient -t &

from a terminal, the terminal gets corrupted.  The terminal shows the
emacs buffer, but the shell and not emacs receives the keystrokes.
Expected behaviour would be to stop emacsclient immediately when it is
started in the backround and needs the current tty. This would be
consistent with behaviour of "emacs -Q -nw &"

The attached patch for emacsclient.c fixes this problem by checking if
emacsclient is started in the background, and raising SIGSTOP, if that
is the case.  This fixes the problem for me, but I cannot guarantee that
this has no side effects.



In GNU Emacs 24.3.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.10.7)
 of 2014-01-28 on var-lib-archbuild-extra-x86_64-juergen
Windowing system distributor `The X.Org Foundation', version 11.0.11500000
System Description:	Arch Linux

Configured using:
 `configure '--prefix=/usr' '--sysconfdir=/etc' '--libexecdir=/usr/lib'
 '--localstatedir=/var' '--with-x-toolkit=gtk3' '--with-xft'
 'CFLAGS=-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector
 --param=ssp-buffer-size=4'
 'LDFLAGS=-Wl,-O1,--sort-common,--as-needed,-z,relro'
 'CPPFLAGS=-D_FORTIFY_SOURCE=2''

Important settings:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix
  default enable-multibyte-characters: t

Major mode: Lisp Interaction

Minor modes in effect:
  tooltip-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
M-x r e p o <tab> r <tab> <return>

Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.
Making completion list...

Load-path shadows:
None found.

Features:
(shadow sort gnus-util mail-extr emacsbug message format-spec rfc822 mml
mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev
gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util
mail-prsvr mail-utils help-mode easymenu time-date tooltip ediff-hook
vc-hooks lisp-float-type mwheel x-win x-dnd tool-bar dnd fontset image
regexp-opt fringe tabulated-list newcomment lisp-mode register page
menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock
syntax facemenu font-core frame cham georgian utf-8-lang misc-lang
vietnamese tibetan thai tai-viet lao korean japanese hebrew greek
romanian slovak czech european ethiopic indian cyrillic chinese
case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer loaddefs
button faces cus-face macroexp files text-properties overlay sha1 md5
base64 format env code-pages mule custom widget hashtable-print-readable
backquote make-network-process dbusbind dynamic-setting
system-font-setting font-render-setting move-toolbar gtk x-toolkit x
multi-tty emacs)
[0001-Fix-emacsclient-s-behavior-when-started-in-backgroun.patch (text/x-diff, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#16892; Package emacs. (Wed, 05 Mar 2014 08:08:01 GMT) Full text and rfc822 format available.

Message #8 received at 16892 <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: 16892 <at> debbugs.gnu.org
Subject: Re: 24.3; terminal corruption after emacsclient -t &
Date: Wed, 05 Mar 2014 00:07:00 -0800
[Message part 1 (text/plain, inline)]
Thanks for the bug report.  How about the attached (untested) patch 
instead?  It checks for tcgetpgrp failure.  Also, the glibc manual 
suggests that emacsclient should be killing its process group with 
SIGTTIN, not itself with SIGSTOP.  See:

http://www.gnu.org/software/libc/manual/html_node/Foreground-and-Background.html
[emacsclient.diff (text/plain, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#16892; Package emacs. (Sun, 09 Mar 2014 19:05:01 GMT) Full text and rfc822 format available.

Message #11 received at 16892 <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: a.amann <at> ucc.ie
Cc: 16892 <at> debbugs.gnu.org
Subject: Re: 24.3; terminal corruption after emacsclient -t &
Date: Sun, 09 Mar 2014 12:04:24 -0700
Have you had a chance to look at the Emacs patch I suggested on March 5 in:

http://bugs.gnu.org/16892#8

?  If there's anything I can do to make it easier for you to try the 
patch, please let me know.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#16892; Package emacs. (Sun, 09 Mar 2014 21:50:02 GMT) Full text and rfc822 format available.

Message #14 received at 16892 <at> debbugs.gnu.org (full text, mbox):

From: Andreas Amann <a.amann <at> ucc.ie>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: 16892 <at> debbugs.gnu.org
Subject: Re: 24.3; terminal corruption after emacsclient -t &
Date: Sun, 9 Mar 2014 21:49:50 +0000
Paul Eggert <eggert <at> cs.ucla.edu> writes:
> Have you had a chance to look at the Emacs patch I suggested on March 5 in:
>
> http://bugs.gnu.org/16892#8


yes, I can confirm that with your patch "emacsclient -t &" now works as
expected. Thank you!







Reply sent to Paul Eggert <eggert <at> cs.ucla.edu>:
You have taken responsibility. (Sun, 09 Mar 2014 22:40:03 GMT) Full text and rfc822 format available.

Notification sent to <a.amann <at> ucc.ie>:
bug acknowledged by developer. (Sun, 09 Mar 2014 22:40:04 GMT) Full text and rfc822 format available.

Message #19 received at 16892-done <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Andreas Amann <a.amann <at> ucc.ie>
Cc: 16892-done <at> debbugs.gnu.org
Subject: Re: 24.3; terminal corruption after emacsclient -t &
Date: Sun, 09 Mar 2014 15:38:49 -0700
You're welcome; closing the bug report.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 07 Apr 2014 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 9 years and 357 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.