Dmitry Gutov writes: > When a Tramp connection is configured as "direct-async-process", > > 1. If the buffer *Async Shell Command* does not exist, invoking M-& in > a remote buffer from that connection makes it end with > > Process *Async Shell Command* finished tramp-handle-make-process must suppress the default sentinel internal-default-process-sentinel. The counter-part, tramp-sh-handle-make-process, does it already, that's why you don't see this message when direct async processes aren't enabled. > 2. If the buffer such named already exists when command is invoked, > then this doesn't happen (the output seems correct). But *Messages* > says > > -l: finished. > > ...which is a big puzzling as well. This is due to shell-command-sentinel. It uses (process-command process) to determine the finished command. In the local case, this returns somethiong like ("/usr/bin/sh" "-c" "ls"). In the remote case, it looks different: --8<---------------cut here---------------start------------->8--- ("ssh" "-q" "-o" "ControlMaster=auto" "-o" "ControlPath=/home/albinus/.cache/emacs/tramp.%C" "-o" "ControlPersist=no" "-e" "none" #("gandalf" 0 7 (tramp-default t)) "cd" "/home/albinus/" "&&" "(" "env" "INSIDE_EMACS\\=30.0.50\\,tramp\\:2.7.1-pre" "PATH\\=/home/albinus\\:/usr/share/Modules/bin\\:/usr/local/bin\\:/usr/bin\\:/usr/local/sbin\\:/usr/sbin\\:/var/lib/snapd/snap/bin\\:/home/albinus/.local/bin\\:/bin\\:/sbin" "ENV\\=\\'\\'" "TMOUT\\=0" "LC_CTYPE\\=\\'\\'" "CDPATH\\=" "HISTORY\\=" "MAIL\\=" "MAILCHECK\\=" "MAILPATH\\=" "PAGER\\=cat" "autocorrect\\=" "correct\\=" "/bin/sh -c ls" ")") --8<---------------cut here---------------end--------------->8--- So the sentinel must inspect the process property remote-command first. I've tried to fix both problems. Could you, pls, check the appended patch? Best regards, Michael.