Skip to content

Commit 72011f2

Browse files
committed
Fix bug 39218
* lisp/simple.el (shell-command): Ensure a shell command ending with `&' is run asynchronously.
1 parent 6f58054 commit 72011f2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lisp/simple.el

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3646,10 +3646,11 @@ impose the use of a shell (with its need to quote arguments)."
36463646
(if handler
36473647
(funcall handler 'shell-command command output-buffer error-buffer)
36483648
(if (and output-buffer
3649+
(not (string-match "[ \t]*&[ \t]*\\'" command))
36493650
(or (eq output-buffer (current-buffer))
36503651
(and (stringp output-buffer) (eq (get-buffer output-buffer) (current-buffer)))
36513652
(not (or (bufferp output-buffer) (stringp output-buffer))))) ; Bug#39067
3652-
;; Output goes in current buffer.
3653+
;; Synchronous command with output in current buffer.
36533654
(let ((error-file
36543655
(and error-buffer
36553656
(make-temp-file

0 commit comments

Comments
 (0)