From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Michael Albinus via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#71049: async-shell-command ends with "Process *Async Shell Command* finished" when remote "direct-async-process" Date: Sat, 25 May 2024 17:51:22 +0200 Message-ID: <877cfhubyd.fsf@gmx.de> References: <3a497741-2ad0-4919-b7c9-cdb36b0eb455@gutov.dev> <8734q7h35d.fsf@gmx.de> <87ttinfgoa.fsf@gmx.de> <861q5r2ric.fsf@gnu.org> <87o78vf9l2.fsf@gmx.de> <86sey711m6.fsf@gnu.org> <221919a1-950e-4ef3-975d-f86078d8e105@gutov.dev> <87wmnidv3u.fsf@gmx.de> <25dad14a-397c-4052-908c-121e40bbef51@gutov.dev> Reply-To: Michael Albinus Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2975"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Eli Zaretskii , 71049@debbugs.gnu.org To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat May 25 17:52:06 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sAtgk-0000XD-My for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 25 May 2024 17:52:06 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sAtgZ-0000sq-93; Sat, 25 May 2024 11:51:55 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sAtgY-0000sh-GV for bug-gnu-emacs@gnu.org; Sat, 25 May 2024 11:51:54 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sAtgY-0006wP-6e for bug-gnu-emacs@gnu.org; Sat, 25 May 2024 11:51:54 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sAtgf-0004az-NR for bug-gnu-emacs@gnu.org; Sat, 25 May 2024 11:52:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Michael Albinus Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 25 May 2024 15:52:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71049 X-GNU-PR-Package: emacs Original-Received: via spool by 71049-submit@debbugs.gnu.org id=B71049.171665230317653 (code B ref 71049); Sat, 25 May 2024 15:52:01 +0000 Original-Received: (at 71049) by debbugs.gnu.org; 25 May 2024 15:51:43 +0000 Original-Received: from localhost ([127.0.0.1]:44165 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sAtgM-0004af-Lj for submit@debbugs.gnu.org; Sat, 25 May 2024 11:51:43 -0400 Original-Received: from mout.gmx.net ([212.227.15.19]:45499) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sAtgJ-0004aX-L1 for 71049@debbugs.gnu.org; Sat, 25 May 2024 11:51:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.de; s=s31663417; t=1716652283; x=1717257083; i=michael.albinus@gmx.de; bh=gclVPOqO1uZwht2BSPmXY7u/ANnAU/QwpRg+X8t5384=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date: Message-ID:MIME-Version:Content-Type:cc:content-transfer-encoding: content-type:date:from:message-id:mime-version:reply-to:subject: to; b=cVrbnaN5QIVGLWsgG2AENFMQCEWBNhnjWh3EkGcfVz7aikzboAR1SzLx60OdzCd/ dXaaez28c81xQr1Rvaoqi6EjC0j/iFpcKDL0b81p8BMUxXQMrwwWMrij9zjDTNCeJ ilaQu2q4aVq5DVGkBTemF7/5qMSJxJd8ZEyBb6V1UB2ok5xVgiPFKJbyQTQiPp1kH L6gxQVwRf7jfJyOZaBt3YO+vyUXLKQVMAuu7CXYb/A2sqnivxyiuMBUhWQ3+GT65x 5H2JYrmOSAqHGYhZJCxRfNhH+88drGqDjDUqr4nHArxvYejMinKsnEaFBtnmjxZwV 87UV+P5ak7EFgXsfgA== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Original-Received: from gandalf.gmx.de ([185.89.38.151]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1N3bWr-1sbGNk26K3-013utl; Sat, 25 May 2024 17:51:23 +0200 In-Reply-To: <25dad14a-397c-4052-908c-121e40bbef51@gutov.dev> (Dmitry Gutov's message of "Sat, 25 May 2024 16:54:54 +0300") X-Provags-ID: V03:K1:3ZrR6A0rHI23GFO5USRGn9gM067+GTbImBadzFWBjS9jGncrXZE 8uraMjWFmPwPEgOp1AgtOE+8sIzQ8UDiHyqdKrwvtklCORjugXu2bUBCOViVJ03wggkL4SP vW31gn5rd/w9hUp7AQOiKcTmy/oHvKvJxXgDYPP1Kz/+AQtaSTsRBRQFafDGoUN9Q0NWBG+ m4js1qXeH33Hiw/vWdtNA== UI-OutboundReport: notjunk:1;M01:P0:S7zxvAr/+VY=;N2JtpCpFKqFWRP+ZtVkGMcwsush m3jvSpH/w0/ABvdnxTmSXYAmI+IH8+k+sENXTavztSMXzE01Ia17P0VcH0gLgZ+oo+ddl0T7W pf2hSMEnUKV+67ajUOIh1BSoxbS6Ha5vG6VMlP3MfyulwGek3uL+Qjax+qN6ANkKxuDK1GM8F OkQd33SSvKqa3GWlmXzQdQdX9MwSuAB5V3KWMrDE9tIXMvsUyPOUFaloX/Bkwod4GhOkxtQKI XUPlufnWQj6RL30zB5Nwtwr7qIMyJjalE7fQFReJMHq7smd5sluwcYJQ2WOIulYImkMThZvW/ RDZEGiYtBiica9vaBWekQ7uMZsqhJfCpCfle/B5V7ZKnJ3dj/bZc4HBUt0Dzhs/bIB0QhuMyX JKsGtxwflHrnWb3roJqTKE5dUdGka/59kEK8ncsb0b3Q82R2YDV+c0t7dAkgFISMU6oY8RnHM Z3//0d+GdHDw2LyXHbE2Yhnb5LgQspjA64x5E6rPGlMrXfMLsBi3MbyycgRzfJ6MI0UfqHlMQ SqxKhAYHpjpPJe2jzBPrJi2dsq7EGk8gV2jfVPADV4u3Z9gEqdTKMscvxb0COXmmCrZegAck9 tyjVSUTPHwCoVsM6/XzN9qQfbTQ8vSDjJbzRqKbIgZRGMImU+SZsj/Gu3T7U6ZCNIMNiDaAcj 8jvQLS8du4u6HB5B9MUwY41lInxF5C4Gdl2vLKFwne4ksKVKvy0NAkK9Nafs6oZS3zmawMXRH xC7zOcwnkd0W8vSTn+sw9yfRiDSji8s6Ku211vTwk0W65YX3roMM7EkM7bfufjFxjXf7O8yT X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:285890 Archived-At: Dmitry Gutov writes: > Hi Michael, Hi Dmitry, >>> The answer is that async-shell-command uses shell-mode as the major >>> mode for the output buffer. For syntax highlighting, I guess. >>> >>> You make a good point that the shell history for such buffers would >>> usually make no sense - even if the running process takes user input >>> (usually not, but sometimes it might) - its input history would be >>> different from the shell. >>> >>> So maybe we could just move the last form in shell-mode (which >>> initializes comint-input-ring) to 'shell' >> Don't know. (shell-mode) is called in shell-command since bcad49851742 >> (1995-07-17). And it is called in tramp-handle-shell-command since >> f5e29b9b70a5 (2011-09-04). >> (comint-read-input-ring) is called in shell-mode since >> (1993-10-22). There might be packages which trust on the >> comint-input-ring existence for buffers in shell mode, even if such >> buffers are created by shell-command.. > > Yes, it would be an incompatibility - so we'll need to consider the > migration path. See the attached patch - I suggest that any callers of > 'shell-mode' that need the exact same input-ring setup also call > shell-setup-input-ring (if it's fboundp - a version check). > > Or I suppose we could check the value of shell-setup-input-ring and > skip history loading when it is empty. It's a more subtle > incompatibility which might affect (or not) third-party code in > similar ways. > > Either of the attached patches solves this part of the problem for me, > please take your pick. I'm really not convinced that we should change shell-mode in an incompatible way for such a minor problem of (not) loading the remote history file. shell-mode is one of the building blocks Emnacs consists of. Instead we must give the user a config option to suppress this. I've shown a possible way to do with my patch, but anything else, which keeps compatibility of shell-mode, would do. Eli? Best regards, Michael.