From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Miles Bader Newsgroups: gmane.emacs.help Subject: Re: Doing Linux admin work with Emacs Date: Sat, 16 Oct 2010 12:16:51 +0900 Message-ID: <87eibq3jz0.fsf@catnip.gol.com> References: <70fd06bf-4566-4274-9381-ee569700cabd@n40g2000vbb.googlegroups.com> <8762x6jnde.fsf@kuiper.lan.informatimago.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1291871446 17049 80.91.229.12 (9 Dec 2010 05:10:46 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 9 Dec 2010 05:10:46 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Dec 09 06:10:42 2010 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PQYm6-0000o7-I2 for geh-help-gnu-emacs@m.gmane.org; Thu, 09 Dec 2010 06:10:38 +0100 Original-Received: from localhost ([127.0.0.1]:42552 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PQYm5-0007se-Sq for geh-help-gnu-emacs@m.gmane.org; Thu, 09 Dec 2010 00:10:37 -0500 Original-Path: usenet.stanford.edu!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 52 Original-X-Trace: individual.net BRlWn1X2AAjncwsqHPRJdQ0yXk/UVWdFJpd/yXiOzOgV+O1T2b Cancel-Lock: sha1:QWEVnLuDt2dS2+JuuLWRYaTI1FY= sha1:M5J18RwkyU4cP+DYRMBGaBNgsq4= System-Type: x86_64-unknown-linux-gnu Original-Xref: usenet.stanford.edu gnu.emacs.help:181813 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:76714 Archived-At: Barry Margolin writes: >> Hmm, by if Emacs was configured correctly, "C-c C-c" should handle this > > What do you mean by "configured correctly"? Is this an option the user > can configure? Or are you referring to a compile-time setting? Well, both compile-time settings and run-time settings. Of course, the handling of ptys/ioctls/etc is very system-dependent, and there's tons of different compile-time-selected code-paths in Emacs to handle them on different types of systems -- but configure should get that right mostly. At runtime, the only configuration I'm aware of is whether pipes or ptys are used for subprocesses (via the `process-connection-type' variable, defaulting to t [ptys] on most non-Windows systems I think). If Emacs uses pipes for subshells, things generally work less nicely. > Where does it say that? It repeatedly says that it sends the signal to > a process or process group, it never says anything about sending a > signal to the pty. But ordinary users aren't allowed to send signals to > processes owned by other users. Typing C-c gets around this, because > the terminal driver interprets this, and it's able to send signals to > any process connected to the terminal (since it's in the kernel, it > could actually send signals to any process, but it never would). On linux, at least, Emacs just sends the appropriate interrupt character to the pty master as if the user had typed it. So if the user types "C-c C-c" in a shell buffer, comint calls (interrupt-process ...), which in process.c gets turned into process_send_signal (..., SIGINT, ...) -- but then process_send_signal notices it's a pty and SIGINT, and turns around and just sends "^C" to the pty as input! This isn't pretty, and has problems of its own, but it does generally handle the "interrupting a sudo'd command in a shell buffer" case as users expect. > I'm running the Carbon Emacs build of Emacs 22.2, but I had the same > problem years ago on Solaris. Dunno if it's broken on 22.x (haven't used that for ages), but I have the vague impression that things have basically behaved the same way for a long time... -Miles -- Youth, n. The Period of Possibility, when Archimedes finds a fulcrum, Cassandra has a following and seven cities compete for the honor of endowing a living Homer.