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: Thu, 14 Oct 2010 19:17:13 +0900 Organization: NEC Electronics Message-ID: 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 1291882746 27246 80.91.229.12 (9 Dec 2010 08:19:06 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 9 Dec 2010 08:19:06 +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 09:19:02 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 1PQbiQ-00073D-Mc for geh-help-gnu-emacs@m.gmane.org; Thu, 09 Dec 2010 09:19:02 +0100 Original-Received: from localhost ([127.0.0.1]:36491 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PQbiP-0004Nv-Np for geh-help-gnu-emacs@m.gmane.org; Thu, 09 Dec 2010 03:19:02 -0500 Original-Path: usenet.stanford.edu!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 31 Original-X-Trace: individual.net j7J2UYnASuMzGqtubXBsBwEH8AfMAldHa2toLAmHlMPSXuDbFV Cancel-Lock: sha1:ian8X2XWqreCUxXblMpB6V2ROQI= sha1:/4zbyQ1nyv3qD+VDcsnagzlSNB8= System-Type: x86_64-unknown-linux-gnu Blat: Foop Original-Xref: usenet.stanford.edu gnu.emacs.help:181768 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:76866 Archived-At: Barry Margolin writes: >> There's one problem when launching a command with sudo in M-x shell: you >> cannot kill it with emacs C-c C-c, since emacs runs as a normal user, it >> cannot kill the sudo'ed process. > > You can kill it by typing C-q C-c RET. This sends a literal C-c to the > shell's terminal, instead of Emacs sending a signal to the process. Hmm, by if Emacs was configured correctly, "C-c C-c" should handle this case properly though -- it uses (interrupt-subprocess nil t): (interrupt-process &optional PROCESS CURRENT-GROUP) Interrupt process PROCESS. PROCESS may be a process, a buffer, or the name of a process or buffer. No arg or nil means current buffer's process. Second arg CURRENT-GROUP non-nil means send signal to the current process-group of the process's controlling terminal rather than to the process's own process group. If the process is a shell, this means interrupt current subjob rather than the shell. ... which basically interrupts the "terminal" (pty) rather than the process itself. Also, it Works For Me :) -miles -- Patience, n. A minor form of despair, disguised as a virtue.