GNU bug report logs -
#29156
25.3; eshell/kill does not understand -<signal>
Previous Next
Reported by: Pierre Neidhardt <ambrevar <at> gmail.com>
Date: Sun, 5 Nov 2017 11:32:02 UTC
Severity: normal
Tags: confirmed, easy, fixed
Found in version 25.3
Fixed in version 27.1
Done: Noam Postavsky <npostavs <at> gmail.com>
Bug is archived. No further changes may be made.
Full log
Message #8 received at 29156 <at> debbugs.gnu.org (full text, mbox):
tags 29156 + confirmed
quit
Pierre Neidhardt <ambrevar <at> gmail.com> writes:
> - emacs -Q
> - M-x eshell
>
> ~ $ kill -9 emacs
> kill: bad pid: -9
This bit converts the "-9" into an integer:
(defun eshell-lisp-command (object &optional args)
...
;; if any of the arguments are flagged as numbers
;; waiting for conversion, convert them now
(unless (get object 'eshell-no-numeric-conversions)
(while args
(let ((arg (car args)))
(if (and (stringp arg)
(> (length arg) 0)
(not (text-property-not-all
0 (length arg) 'number t arg)))
(setcar args (string-to-number arg))))
(setq args (cdr args))))
...
Whereas this bit expects "-9" as a string:
(defun eshell/kill (&rest args)
...
(when (stringp arg)
(cond
((string-match "\\`-[[:digit:]]+\\'" arg)
(setq signum (abs (string-to-number arg))))
((string-match "\\`-\\([[:upper:]]+\\|[[:lower:]]+\\)\\'" arg)
(setq signum (abs (string-to-number arg)))))
...
Using "-SIGKILL" doesn't work either, because eshell/kill calls
`string-to-number' on it, giving 0. Apparently nobody ever actually
used this feature before.
This bug report was last modified 7 years and 63 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.