[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Doing Linux admin work with Emacs
From: |
Miles Bader |
Subject: |
Re: Doing Linux admin work with Emacs |
Date: |
Wed, 08 Dec 2010 15:31:49 -0000 |
Barry Margolin <barmar@alum.mit.edu> 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.
Re: Doing Linux admin work with Emacs, Tim X, 2010/12/08
Re: Doing Linux admin work with Emacs, Richard Riley, 2010/12/09