From 1c737673032422e0eaf40427b2ec5124747b2f94 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Fri, 20 May 2022 01:35:58 +0200 Subject: [PATCH] Make `&' in dired be more consistent wrt. user input * lisp/dired-aux.el (dired-do-async-shell-command): Mention that commands here don't accept input. --- lisp/dired-aux.el | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el index d2bac5c467c..a98425d1290 100644 --- a/lisp/dired-aux.el +++ b/lisp/dired-aux.el @@ -819,7 +819,9 @@ are executed in the background on each file sequentially waiting for each command to terminate before running the next command. In shell syntax this means separating the individual commands with `;'. -The output appears in the buffer named by `shell-command-buffer-name-async'." +The output appears in the buffer named by `shell-command-buffer-name-async'. + +Commands that are run asynchronously do not accept user input." (interactive (let ((files (dired-get-marked-files t current-prefix-arg nil nil t))) (list @@ -997,7 +999,13 @@ Also see the `dired-confirm-shell-command' variable." (when (cdr file-list) (setq files (concat dired-mark-prefix files dired-mark-postfix))) (funcall stuff-it files)))) - (or (and in-background "&") "")))) + (or (and in-background + (if (not w32-shell) + ;; Work the same as the `on-each' case -- don't + ;; accept user input in the output buffer. + "&wait" + "&")) + "")))) ;; This is an extra function so that it can be redefined by ange-ftp. ;;;###autoload -- 2.39.2