From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Michael Albinus Newsgroups: gmane.emacs.bugs Subject: bug#49229: 27.2; `M-x shell' fails over TRAMP from local MS Windows Date: Sat, 26 Jun 2021 16:33:23 +0200 Message-ID: <87h7hkpufg.fsf@gmx.de> References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8387"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 49229@debbugs.gnu.org To: Jim Porter Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jun 26 16:34:14 2021 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 1lx9Nt-00023P-Ns for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 26 Jun 2021 16:34:13 +0200 Original-Received: from localhost ([::1]:44544 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lx9Ns-00010c-Mr for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 26 Jun 2021 10:34:12 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50960) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lx9Ni-00010U-Fq for bug-gnu-emacs@gnu.org; Sat, 26 Jun 2021 10:34:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:36914) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lx9Ni-0003ZU-2B for bug-gnu-emacs@gnu.org; Sat, 26 Jun 2021 10:34:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lx9Nh-0002LD-UF for bug-gnu-emacs@gnu.org; Sat, 26 Jun 2021 10:34: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, 26 Jun 2021 14:34:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49229 X-GNU-PR-Package: emacs Original-Received: via spool by 49229-submit@debbugs.gnu.org id=B49229.16247180178966 (code B ref 49229); Sat, 26 Jun 2021 14:34:01 +0000 Original-Received: (at 49229) by debbugs.gnu.org; 26 Jun 2021 14:33:37 +0000 Original-Received: from localhost ([127.0.0.1]:48460 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lx9NI-0002KX-W9 for submit@debbugs.gnu.org; Sat, 26 Jun 2021 10:33:37 -0400 Original-Received: from mout.gmx.net ([212.227.15.18]:53485) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lx9ND-0002KH-R0 for 49229@debbugs.gnu.org; Sat, 26 Jun 2021 10:33:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1624718005; bh=xW09KUq6gi8fEbOedWIV5C1Q0jAJgXDWCaEZRBM5Pl8=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=O2FkF0Jxb0WonfgtY8icG7Uxus8X/y4yIvIz3I20zQHsnWcKYPB1Hg8OZYv92oEzM uUdg+8EG1Bcy9IDRUUpX+f5TZMWzUKlBfygPZ40g6xcmhuIy9rZ3sOms+orhw/9sxl K3NIjVJBlyjLtGcic2lwySgP0WsWBJ7QBOLTTWrk= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from gandalf.gmx.de ([79.140.124.38]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1M2O2W-1lxh4U3fZ8-003v9k; Sat, 26 Jun 2021 16:33:25 +0200 In-Reply-To: (Jim Porter's message of "Fri, 25 Jun 2021 16:05:57 -0700") X-Provags-ID: V03:K1:r4zau/kspHeQ2uqIRM9wkMKoGpjQx3h0hx8fqDKmrWfNNSqVIYq kQAWuAYtL0ydl5NZyZM6OEwxOEF/fLkN5j2WSi8RNgpIHss6wRfc45H3B6vlDImYptg/Jy3 kXmw8onPl55OfJ6l9QRv2KU9MHV55EhwbOgzWz/YUe1qa618EXo20yFC8zuQI6DLRzrI7Iz pH60/4DE3sfbLilDruKQw== X-UI-Out-Filterresults: notjunk:1;V03:K0:1EHUQM0DtRg=:GRLMo9ptrlgi5hDUt2Lzoj 3JHOQNDVfXTJG7AmoiNjW4a9cH2YsY9mmb8UTs5+pDZSmYnXyMylJFnUA/Gw0aCbHLGV5rbyt au6imG43ZUqDENlIx8/t8opVeh5bOOZuk4n0QL2USyHc2+jMhWaFRZGeb4242GngwWo9DiCdX jDjeFP8Ms8XfLxO91FYU9HaiAxYU+X/UpUWqyaX3SBIoIomiiwuHObF5pVD9obosuPjjgJFeO dOD4zU/JLVoHJRP8iABwhrAnAOZp0x87hwMk1eVXW+QbD3Mt7o/r4xryFViFTwZmIWrppCuvQ ssOFy1qNhg4lfeYdxYm0HXSeYc9DAvvWl6pDZ/RjsI4Fj3rmJsd01Ui1Rvh0eek2qOaPZcoyZ 722traGStwXRyjwb00auS6JnWfOxQZEGIUxVNqVRr0XWr3QdlJYmvRWFjH8hOidCdaIonLs/+ eMAq1a7cOjcn1F331jOK/BPeVYQ0GudVrIu1J9crm5d2I6Yw/QLBEDJC9kDP/QaadDgh3gJfQ 9VJwSxhMHwAVkhxZ2ZzQ1R5DL9TzbtIU9nBlKSWwMsaz+/YYwoWz9rk1J0j5O5LjwfN8V4II2 OorMW9PBuKbN1w72Z9TDA2BDY2nbfYV1yV3t65TYqZ0f7wNX/olLNxuFBZvwRbSjkJfWf0ipr R9F9jk+JCgHmf/6v5JYKBni+OlNKGJo6C2mZPHkxREzqKUf9pzF1PmLyFCBJPgo4M/M+QLOgV +Ul2Qyxzfz7gRzg6JoziJveini58vCrHLmDoiCytm234VWbg0cK4FVtNLxCM4uZWk5H9wWYY 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" Xref: news.gmane.io gmane.emacs.bugs:209020 Archived-At: Jim Porter writes: Hi Jim, > Eval'ing that from a TRAMP buffer and hitting RET returns "/bin/sh" > (i.e. `shell-file-name'); that is, we lost the TRAMP prefix, even > though the prompt made it look like we'd keep it. If you edit the path > to, say, "/sshx:server:/path/to/some//usr/bin/zsh" and hit RET, the > result is "/sshx:server:/usr/bin/zsh", which is good. The result of > this call is then passed to `expand-file-name', which on MS Windows, > turns "/bin/sh" into "c:/bin/sh". Finally, that gets called on the > remote (running GNU/Linux), and things break. Thanks for this report. Occasionally, I've seen this problem on MS Windows already. Since I don't run anything on MS Windows unless for bug hunting, I couldn't locate it yet. With your recipe, it's reproducible now. It's not related to "M-x shell" only, but more general. > I've attached a WIP patch that resolves this, but I don't think it's > quite right (hence, I didn't use `git format-patch'). This seems to be > more of an issue with `read-file-name' not being smart enough; even if > we set the `default-filename' argument to nil, the default return > value is still a local (non-TRAMP) path, which isn't right. Since > `read-file-name' is better able to tell whether the user wanted the > default value or they specifically wanted a local shell, it might be > better to fix the issue there. However, that's a pretty widely-used > function, and I'm hesitant to change the behavior in > potentially-breaking ways. I've pushed a fix to the master branches of Emacs and Tramp. Could you, pls, check? Best regards, Michael.