Skip to content

Commit e1deafd

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

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
@@ -3640,10 +3640,11 @@ impose the use of a shell (with its need to quote arguments)."
36403640
(if handler
36413641
(funcall handler 'shell-command command output-buffer error-buffer)
36423642
(if (and output-buffer
3643+
(not (string-match "[ \t]*&[ \t]*\\'" command))
36433644
(or (eq output-buffer (current-buffer))
36443645
(and (stringp output-buffer) (eq (get-buffer output-buffer) (current-buffer)))
36453646
(not (or (bufferp output-buffer) (stringp output-buffer))))) ; Bug#39067
3646-
;; Output goes in current buffer.
3647+
;; Synchronous command with output in current buffer.
36473648
(let ((error-file
36483649
(and error-buffer
36493650
(make-temp-file

0 commit comments

Comments
 (0)