From debbugs-submit-bounces@debbugs.gnu.org Fri Jun 25 19:06:16 2021 Received: (at submit) by debbugs.gnu.org; 25 Jun 2021 23:06:16 +0000 Received: from localhost ([127.0.0.1]:46924 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lwutr-0004CA-NI for submit@debbugs.gnu.org; Fri, 25 Jun 2021 19:06:15 -0400 Received: from lists.gnu.org ([209.51.188.17]:42254) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lwuto-0004Bz-Kp for submit@debbugs.gnu.org; Fri, 25 Jun 2021 19:06:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45890) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lwuto-0002jB-Fv for bug-gnu-emacs@gnu.org; Fri, 25 Jun 2021 19:06:12 -0400 Received: from mail-pf1-x42e.google.com ([2607:f8b0:4864:20::42e]:39779) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lwutm-0003Is-PL for bug-gnu-emacs@gnu.org; Fri, 25 Jun 2021 19:06:12 -0400 Received: by mail-pf1-x42e.google.com with SMTP id g192so8627721pfb.6 for ; Fri, 25 Jun 2021 16:06:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=tnA5mutKG7tet3+VBXANZWC6ZoV6zgOue1irIRdrrAo=; b=Jt4zUoIiZ0hYgAk+z8dZ7kdmGxUhPQ0l5fA5c4AKzttg+TD10lvae2avxry7HPpSWR 1NAmMCflUz7XVU7kFWIoThY1vaDBLeV9w26naV01p2mWpE98oF8hyv2wbVa1+FKx2vMR fpDFrZ7A/SO25VE/VkD0cfS40OiA/V24REKuZRrTl7U8wJjG05ovfLxBZ84l59ft8jtE MkLMoAgXIDuYd1AZ9rs+zYu9tK+sCiSGWftm9ycPQ3BR7AHUAlk4TIKW3j0gXdsatyeK 7P73BN9i1BpO3PzkaAi3857G25NNPv+nwOSYRbTMX5lL06/CfhLR97HuuQfaRKhTuHy5 EPTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=tnA5mutKG7tet3+VBXANZWC6ZoV6zgOue1irIRdrrAo=; b=GNPTlqgjeBKUmUH+icGBlPMVDTmZf7g9gFL7oY/n94TJSwJRKP8kjVkoHFcvgDX/Ft Ur7jcQ/UanC/rBU7j452wfqRMpb1JsY2leV+I3pKeTcWDLXwEz3EjBT5Njf+8BJHEi3S 70mxvNqK1Bs9kg+Y61x0ZTh1Enns4U5jI/G/gN0SHMjXqmvaa4RpAJBiAsR7AxJOCI2m 6NHSVV8dsF5hIqCiUEo5xlWHBUcUxJriMFekFAzZ+pxj8vS+fcQJv+fBe1KUz5YAQFxJ 9Ww2rGPjtcHPMwCJfdntrpVQMsUGVqP0CjbYXwxYNWvW05aS9CnHlo11pnhijJif8GQA X84g== X-Gm-Message-State: AOAM533t+92nveQ37F8IeCboKsorqpPSSvsYCdQ1Y/41lDjAUpFFjQVP LStXdvj3bkHO6BIXHMw1gpMgJGw+aX4x8iXUdTAz8J5NzXE= X-Google-Smtp-Source: ABdhPJwsYDL3yZvxMC2fKpn74Loaf/tdF1Y6F0Otec5FnzF/o1idK8RiIurcSuRn3F0tHY1RbCYQ4KWHiKPNgXQTBXQ= X-Received: by 2002:aa7:9464:0:b029:306:3984:b22a with SMTP id t4-20020aa794640000b02903063984b22amr12743698pfq.81.1624662368202; Fri, 25 Jun 2021 16:06:08 -0700 (PDT) MIME-Version: 1.0 From: Jim Porter Date: Fri, 25 Jun 2021 16:05:57 -0700 Message-ID: Subject: 27.2; `M-x shell' fails over TRAMP from local MS Windows To: bug-gnu-emacs@gnu.org Content-Type: multipart/mixed; boundary="00000000000056480205c59f2f63" Received-SPF: pass client-ip=2607:f8b0:4864:20::42e; envelope-from=jporterbugs@gmail.com; helo=mail-pf1-x42e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) --00000000000056480205c59f2f63 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable (Note: I primarily tested on 27.2, but this doesn't look to be any different on 28.0.50.) When invoking `M-x shell' over TRAMP from a local MS Windows system, the default remote shell path is corrupted: emacs -Q C-x C-f /sshx:server:~/some/file.txt M-x shell ;; See the default prompt value: ;; /sshx:server:/path/to/some//bin/sh ;; ("/path/to/some/" is greyed out) RET The result is: "env: =E2=80=98c:/bin/sh=E2=80=99: No such file or directory= ". You can also see this with the code used in `M-x shell' to get the remote shell path: (read-file-name "Remote shell path: " default-directory shell-file-name t shell-file-name) 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. 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. If the current WIP patch does look good though, I can clean it up (add a comment and a commit message) for it to be merged. Or I can try to fix `read-file-name' if there's agreement about how it should work in this case. --00000000000056480205c59f2f63 Content-Type: application/octet-stream; name="shell-tramp.patch" Content-Disposition: attachment; filename="shell-tramp.patch" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_kqcxo9c80 ZGlmZiAtLWdpdCBhL2xpc3Avc2hlbGwuZWwgYi9saXNwL3NoZWxsLmVsCmluZGV4IDYyZGU1YmU4 MTcuLmU3MzY5NDY0ZmQgMTAwNjQ0Ci0tLSBhL2xpc3Avc2hlbGwuZWwKKysrIGIvbGlzcC9zaGVs bC5lbApAQCAtNzUxLDE1ICs3NTEsMTYgQEAgc2hlbGwKIAogICAod2l0aC1jb25uZWN0aW9uLWxv Y2FsLXZhcmlhYmxlcwogICAgOzsgT24gcmVtb3RlIGhvc3RzLCB0aGUgbG9jYWwgYHNoZWxsLWZp bGUtbmFtZScgbWlnaHQgYmUgdXNlbGVzcy4KLSAgICh3aGVuIChhbmQgKGZpbGUtcmVtb3RlLXAg ZGVmYXVsdC1kaXJlY3RvcnkpCi0gICAgICAgICAgICAgIChjYWxsZWQtaW50ZXJhY3RpdmVseS1w ICdhbnkpCi0gICAgICAgICAgICAgIChudWxsIGV4cGxpY2l0LXNoZWxsLWZpbGUtbmFtZSkKLSAg ICAgICAgICAgICAgKG51bGwgKGdldGVudiAiRVNIRUxMIikpKQorICAgKHdoZW4tbGV0ICgocmVt b3RlLWhvc3QgKGZpbGUtcmVtb3RlLXAgZGVmYXVsdC1kaXJlY3RvcnkpKQorICAgICAgICAgICAg ICAoKGNhbGxlZC1pbnRlcmFjdGl2ZWx5LXAgJ2FueSkpCisgICAgICAgICAgICAgICgobnVsbCBl eHBsaWNpdC1zaGVsbC1maWxlLW5hbWUpKQorICAgICAgICAgICAgICAoKG51bGwgKGdldGVudiAi RVNIRUxMIikpKSkKICAgICAgKHNldHEtbG9jYWwgZXhwbGljaXQtc2hlbGwtZmlsZS1uYW1lCiAg ICAgICAgICAgICAgICAgIChmaWxlLWxvY2FsLW5hbWUKICAgICAgICAgICAgICAgICAgIChleHBh bmQtZmlsZS1uYW1lCiAgICAgICAgICAgICAgICAgICAgKHJlYWQtZmlsZS1uYW1lICJSZW1vdGUg c2hlbGwgcGF0aDogIiBkZWZhdWx0LWRpcmVjdG9yeQotICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICBzaGVsbC1maWxlLW5hbWUgdCBzaGVsbC1maWxlLW5hbWUpKSkpKQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoY29uY2F0IHJlbW90ZS1ob3N0IHNoZWxsLWZp bGUtbmFtZSkgdAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaGVsbC1maWxl LW5hbWUpKSkpKQogCiAgICA7OyBSYWluIG9yIHNoaW5lLCBCVUZGRVIgbXVzdCBiZSBjdXJyZW50 IGJ5IG5vdy4KICAgICh1bmxlc3MgKGNvbWludC1jaGVjay1wcm9jIGJ1ZmZlcikK --00000000000056480205c59f2f63-- From debbugs-submit-bounces@debbugs.gnu.org Sat Jun 26 10:33:37 2021 Received: (at 49229) by debbugs.gnu.org; 26 Jun 2021 14:33:37 +0000 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 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 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 From: Michael Albinus To: Jim Porter Subject: Re: bug#49229: 27.2; `M-x shell' fails over TRAMP from local MS Windows References: Date: Sat, 26 Jun 2021 16:33:23 +0200 In-Reply-To: (Jim Porter's message of "Fri, 25 Jun 2021 16:05:57 -0700") Message-ID: <87h7hkpufg.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:r4zau/kspHeQ2uqIRM9wkMKoGpjQx3h0hx8fqDKmrWfNNSqVIYq kQAWuAYtL0ydl5NZyZM6OEwxOEF/fLkN5j2WSi8RNgpIHss6wRfc45H3B6vlDImYptg/Jy3 kXmw8onPl55OfJ6l9QRv2KU9MHV55EhwbOgzWz/YUe1qa618EXo20yFC8zuQI6DLRzrI7Iz pH60/4DE3sfbLilDruKQw== X-Spam-Flag: NO 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 +Ul2Qyxzfz7gRzg6JoziJveini58vCrHLmDoiCytm234VWbg0cK4FVtNLxCM4uZWk5H9wWYYQ 7jP0lWj7AB05/peqm9a0iTG0gbUD6vyE+hZ0wYx9/DzUGoCkIUxu/1CZxfVqHSb1skcyKGRf3 xiiTiEvdEZYwy9ykTLRc5sHhDLxfa3y3KygJ16tssBGlxoh/1++8RCeo9vqNlx2cCplBlAkoW KqWECur8z7jsCi5Z4SZ2Ddx1jjMb88btnjdAGC0Z5WR93u+UQij18bJlf/E65D1YjtfDXAK2d 1w/aBbRVC5EFrXmX3FzCLpKEl3v0vIWgCYlNRev8kDSQy7SPer3lOet8WpZIpH4gVD3To143x Jb/q2slNXj0GPpl08zq6CkzUyN7YeyHmam4Dh25OjuD+lsq47Dw/fs6wQ== X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 49229 Cc: 49229@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) 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. From debbugs-submit-bounces@debbugs.gnu.org Sat Jun 26 14:01:58 2021 Received: (at 49229) by debbugs.gnu.org; 26 Jun 2021 18:01:58 +0000 Received: from localhost ([127.0.0.1]:48604 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lxCcv-0008Ab-UA for submit@debbugs.gnu.org; Sat, 26 Jun 2021 14:01:58 -0400 Received: from mail-pj1-f47.google.com ([209.85.216.47]:54243) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lxCct-0008AL-Po for 49229@debbugs.gnu.org; Sat, 26 Jun 2021 14:01:56 -0400 Received: by mail-pj1-f47.google.com with SMTP id bb20so7314668pjb.3 for <49229@debbugs.gnu.org>; Sat, 26 Jun 2021 11:01:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=vU0WiMbyooYCzRbZUXaXy2Sei5iy2LLRlpsWPt3UDDY=; b=iMUvGBQJtecqowHcd3/vhTQQZgTjmQLN2oMzJ5saehcndJvTnXyRglJBcYy5jhxac+ KyLK7XaGPjYajpVWg+xdgc6ryc4h6eixZFMFFQn0hChIw3LLY4Q3WT/2IBadcEwfui9l 15qtvByk/cJGb6mMOkgC9kYwlFNCAcNokh3zAKBaAdDWn0FTtiuIW/c3E/mGMtUyQZJ5 5zufUvuaq6ttIpbdTN44oQAgNJtIEuitnAi68KpwmV2dnuHcTPdqmyf19K6It8WU0PNT EhPXvRnCTQo1JS7z5afCRijPylbayjGBSsaqPECC5OOILavO8P7AbqhdWAfBNmlvmYgA UGhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=vU0WiMbyooYCzRbZUXaXy2Sei5iy2LLRlpsWPt3UDDY=; b=V+zwzpjif/pwjBaF5fZZYf3c6c5/KyXCnGhyMPykeODUaGCR80dXxW0CAj0BvrR6tA 24YLeEDP8QeWk4V97I3llEqVuf4MjT60XxFsdg0NbJ4efZW62Bb4MIkB4SyFzVAkZXmf UMCJEouB2Tl9yhsLXCL87OMa6T59AeIrsRZlk2kwliVlS5176euKeFrUDtClJ0N15oqa AWjf1bD4mS5smK09LkreUuZOWuR0Go3mNn6I6PkpXxwpAGZ59vy9tAJV/c9E1fg1gQY1 93V12J+irw4Y38PAOkHWJnOENLT8MhfByO1BJ2NbyhKgknW4Xj9OeQAR0e3b/PVgykh1 wncQ== X-Gm-Message-State: AOAM532AfFu2A//zAtiqyua5posSdmzRm84bgt47BUPDPEORTnzjWYc5 y48GHP3v21irA/l/2BrcgiZuqS6vynTB9sVxpY8= X-Google-Smtp-Source: ABdhPJye73UGmRUxPAKZShGoy1kMXEjjrPFKlgmTFg+0rl6HuD1OttYAwi18ypqVQJ/GVAn4CzwRv0yeu+y9qdao7Zs= X-Received: by 2002:a17:90a:708:: with SMTP id l8mr27878721pjl.103.1624730509945; Sat, 26 Jun 2021 11:01:49 -0700 (PDT) MIME-Version: 1.0 References: <87h7hkpufg.fsf@gmx.de> In-Reply-To: <87h7hkpufg.fsf@gmx.de> From: Jim Porter Date: Sat, 26 Jun 2021 11:01:41 -0700 Message-ID: Subject: Re: bug#49229: 27.2; `M-x shell' fails over TRAMP from local MS Windows To: Michael Albinus Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 49229 Cc: 49229@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On Sat, Jun 26, 2021 at 7:33 AM Michael Albinus wrote: > > 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. Looking at your patch, it makes sense to me. It's not where I originally expected the fix to go, but I remember some previous corner cases that were fixed with `tramp-drop-volume-letter', so this should be good. > I've pushed a fix to the master branches of Emacs and Tramp. Could you, > pls, check? I tested on MS Windows and it works correctly for me. (Note that I just copied and eval'ed the new version of `tramp-file-name-handler', since I don't have a proper build environment on MS Windows.) While testing it, I discovered one other oddity though. This doesn't necessarily need a fix, but it's a bit surprising, and I'll mention it here in case someone thinks it's a problem worth fixing. If I erase the default text and instead enter "C:/Windows/System32/cmd.exe" into the `M-x shell' prompt, it treats *that* as a remote path too. Now, the prompt does say to enter a *remote* shell path, so if I enter a local path, I made a mistake. However, the default shell path for `M-x shell' from a remote directory is a TRAMP path ("/sshx:server:/path/to/some//bin/sh"), so it's surprising that when I delete the TRAMP host prefix, I still end up running a shell on the remote server. Perhaps it would be nicer if, when `M-x shell' prompted for the remote shell path, it didn't include the TRAMP prefix by default (e.g. the default value would just be "/bin/sh"). That might not interact well with `read-file-name' completion though; is it possible to use file-name completion on a remote path without the TRAMP prefix? From debbugs-submit-bounces@debbugs.gnu.org Sun Jun 27 04:42:07 2021 Received: (at 49229) by debbugs.gnu.org; 27 Jun 2021 08:42:07 +0000 Received: from localhost ([127.0.0.1]:48907 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lxQMh-0005PP-4N for submit@debbugs.gnu.org; Sun, 27 Jun 2021 04:42:07 -0400 Received: from mout.gmx.net ([212.227.15.18]:52759) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lxQMa-0005Oq-NV for 49229@debbugs.gnu.org; Sun, 27 Jun 2021 04:42:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1624783313; bh=hA6SKviPlt0VuAHJrwSa6o28Bm0eH7BOWrN81Fy8LFw=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=G9OWejy+V62dx1UUQ7FbiDDYLjarIiGr/RkQanlhgPpmurPbvio4HDbz6kCkwoDeh vemyFc+qVqOY/Dx7Ozl41IGtBwWVy6NKijbRwqfTVtpfUnNlIbmj48XJoZq1qe1o0Q lWbIR6KGwHisrOx12e+Sirf+7TfTZDwsknwjTLt8= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from gandalf.gmx.de ([79.140.124.38]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MdvqW-1lQ1Hr2grO-00b1db; Sun, 27 Jun 2021 10:41:53 +0200 From: Michael Albinus To: Jim Porter Subject: Re: bug#49229: 27.2; `M-x shell' fails over TRAMP from local MS Windows References: <87h7hkpufg.fsf@gmx.de> Date: Sun, 27 Jun 2021 10:41:52 +0200 In-Reply-To: (Jim Porter's message of "Sat, 26 Jun 2021 11:01:41 -0700") Message-ID: <87czs7pulr.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Provags-ID: V03:K1:J6alYMx9TPShN2Djtvig9yLp7ezPx/c6rGBG0GgXz7UciPE2D6p 42wzcn77+3rT8uidxrPzoIpGyFb38uxqBUv2vK4il+3KANM5PboBu7YUgRDat/yJ2quyobt D60jY+2tOAGABHZmdRa5NeGLouOwHtrYYSVVH4vL5ifHe5CwJIceRsZ96fUMBYCxyGkzgih sZ/FXImGPUNfKhYbe8guQ== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:wp73eEJCMPU=:0p0ZRvmOqmexsTBzR7Ar7E hefYhtPNMZQLe3mhB7WtifxOjIbn11X64DgYjGf0UPflgnmtg4fk5am5v0oyQ6x6BkL5nGumE /J7TJ29QDIRnUdvpnyxDFJ4s+wSI/z7oGDR+UvMYyaV3AoULgDO7zZZZlhE4B/Nbg1KNLzsIJ mTZ02hrcjFVs9UOaerssq9nNpisRaigBzBGziqydmM6VJhTGAXuSlx0+sscAbPyKot+ABKQ9a sFqqsKI+VnYc4QwI7KadCfDXTkUdKGP9HGvBXW29oU1mvvizN97quuOi6dJ1xjqHkIG4mQRqb 6UCNaARjcV2lMFZFVJZpaEFpnekzj1bQzOybFIuAMW2kRM3dmD5mTou/nuOUy3CPLgANYOIX6 woLN7M7UrKVn+EpSzvWKHWJZ8r2E59nkqpit7W9K4x9LSU6dhNExzB7M8Emgthbfv/3BtC/zC 23Im1TyeJIFaBif+YY6tvDgFSAVe2RnZiHdj/QUsvXhFAA8QJPBgVltI8IWV9pdpPD5KVeCcC 3Fa6b3LAjZaSKVxM+44p5yDVk0DvPs2hLHDy254ne6WqqIWVgmrAi6gJ0mqmSEs29zQ1Huso+ /YsUspx1w6m00RuafUeQ8c6JLlmkW0QiGV7BqOaocT+Pv0/amZrIaaMEKrjkDIJnnVRInMZ+w NM6pMWWFGluzouQ/b7t2p5KVWKnlv2Z2VXkcWyv1PmEbtRQaKiDkYaoieGB1qqL8urhwWS+ze tKLbvI7KvxAjQ2ynide5AYZNQcJCMQ2xBaXbCgaU9n9B6HjIPdYaVLf16LaxQEnoAu2r0JdX0 zV6M/o4YuR3W33P3rDzE90e0/0oE0xQLuKmWmvxRv2K2KGMTQm47ZSQ0OOFIm9fKZv8c2cJd/ IKvilK6tnRTEGItT+t0c0U9m7yxwoF7/HS+/WKlKVXtpkU1FF77n6nzF1UAKVMIM//eMMAiz/ Bfkfd2lQqxyWJbrFluFe0SG/c2fPC4F7vboNaxks+mAXnzXPxULC/5tQ9nRrAw5XXetOCZYjz Tr4V88H7208E6u4RHHiiAp+dcNPxt0lwEqaY6K85zWYmHvgNZPvbN4pIkAcMnfovXoVSzczMX B6/AkuHTUQDsiXpZBc1SzzA8eB9R01MiyLhpcbbIvqtRlvOC57WaQpeqw== X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 49229 Cc: 49229@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --=-=-= Content-Type: text/plain Jim Porter writes: Hi Jim, >> I've pushed a fix to the master branches of Emacs and Tramp. Could you, >> pls, check? > > I tested on MS Windows and it works correctly for me. (Note that I > just copied and eval'ed the new version of `tramp-file-name-handler', > since I don't have a proper build environment on MS Windows.) Thanks for confirmation. > If I erase the default text and instead enter > "C:/Windows/System32/cmd.exe" into the `M-x shell' prompt, it treats > *that* as a remote path too. Now, the prompt does say to enter a > *remote* shell path, so if I enter a local path, I made a mistake. > However, the default shell path for `M-x shell' from a remote > directory is a TRAMP path ("/sshx:server:/path/to/some//bin/sh"), so > it's surprising that when I delete the TRAMP host prefix, I still end > up running a shell on the remote server. `read-file-name' as used in `shell' just reads a file name, no matter whether a local or remote one. > Perhaps it would be nicer if, when `M-x shell' prompted for the remote > shell path, it didn't include the TRAMP prefix by default (e.g. the > default value would just be "/bin/sh"). That might not interact well > with `read-file-name' completion though; is it possible to use > file-name completion on a remote path without the TRAMP prefix? No, that doesn't work. File name completion and alike wouldn't work any more. But we could teach `read-file-name' to accept only remote file names. What about this patch: --=-=-= Content-Type: text/x-patch Content-Disposition: inline Content-Transfer-Encoding: quoted-printable diff --git a/lisp/shell.el b/lisp/shell.el index 62de5be817..4339e8c0a3 100644 =2D-- a/lisp/shell.el +++ b/lisp/shell.el @@ -759,7 +759,8 @@ shell (file-local-name (expand-file-name (read-file-name "Remote shell path: " default-director= y - shell-file-name t shell-file-name))))) + shell-file-name t shell-file-name + #'file-remote-p))))) ;; Rain or shine, BUFFER must be current by now. (unless (comint-check-proc buffer) --=-=-= Content-Type: text/plain It is not perfect, one can still enter "/sudo::/bin/sh" when `default-directory' is "/ssh::". But I wouldn't count this as mistake, it would be rather a "user error by intention" :-) Best regards, Michael. --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sun Jun 27 20:48:15 2021 Received: (at 49229) by debbugs.gnu.org; 28 Jun 2021 00:48:15 +0000 Received: from localhost ([127.0.0.1]:50501 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lxfRf-0000NA-6U for submit@debbugs.gnu.org; Sun, 27 Jun 2021 20:48:15 -0400 Received: from mail-pj1-f42.google.com ([209.85.216.42]:51012) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lxfRV-0000MQ-IL for 49229@debbugs.gnu.org; Sun, 27 Jun 2021 20:48:14 -0400 Received: by mail-pj1-f42.google.com with SMTP id g4so9019186pjk.0 for <49229@debbugs.gnu.org>; Sun, 27 Jun 2021 17:48:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=xwrl8PykgCB1Wq2h9huf77TfImxY2yHCvkCpGSAUgTU=; b=MyytDuztGToREQ530FuETsBbBj2xcpur+XI61F6PK4p+L8WCaPx0Va9xusksOiGQ4K jOVms3Mmts5F4vHnXyXfCAXaumuM9+ETWmEGyRQGE0qRp76+GdaAoD1Tj5cFUgUwx1iS VEKbjolIDN778FuyTazL7H6JCKgDpKejolmMV7tsQgILqE6rSgvwWlQPN+MqkdpYnWJy UJGSVrzeVAMTgnScsFgCQ25WcqYwSnKSRZ2QqCehzqeXuSKpXmUweFkdPT8F68U6aw6v siOuQoHBkSVU/qPlotvDsKDT2EJSre2yos4+S5lEiCsarQmfdllVNLTB/dXOaGOVAFqM Y0GQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=xwrl8PykgCB1Wq2h9huf77TfImxY2yHCvkCpGSAUgTU=; b=TnVEdiNQ9lYW6MqbhiBBsZFmoA+voavY/NlqtgtX+lenHOPhm1+lAnorjZ/+4GPtVp f4nt2cj/AxvUto3rMbzz/E+VS6cxaDuB1bWAKs0moYD9s6tsfnh+OSU/H2YF+ZnpjJ4D eG4aowVkX9v7IB32Y2nKTUTB6j7G8Vhiv1Pz1n01WR2cH2K/fPC8/ekc1Y2PW/xV+8X7 8WFgZsQhx0FBhaFIPlrHCK0hE5tdRyrfiYBwlUVjbKnhQ1PJkaqQivQTLMPmFu7/GHz/ mjXp0BjuHuojwH0UPfUzR8kuWQCFn2IalCerTTIlPqQ5XIproJFRl2a9JYReN0zzpdKN FV+g== X-Gm-Message-State: AOAM533pl6tS6HvfDCnRrZJ/4WNwZOMZXexoOiucOKr1LFEv6fk1n1Ja CkPdORkoKq0pVfgIDXzbL0n5LeB+FWYP+hk71Ms= X-Google-Smtp-Source: ABdhPJy4yLkuau9dJYtQ9cx7zXSgoe52JG0ntjOVkJWMXs378ha9pwp3qczXbJqDCxt7n2DrMU2U+XicxzeUtRKjBFE= X-Received: by 2002:a17:90a:708:: with SMTP id l8mr34661390pjl.103.1624841279726; Sun, 27 Jun 2021 17:47:59 -0700 (PDT) MIME-Version: 1.0 References: <87h7hkpufg.fsf@gmx.de> <87czs7pulr.fsf@gmx.de> In-Reply-To: <87czs7pulr.fsf@gmx.de> From: Jim Porter Date: Sun, 27 Jun 2021 17:47:49 -0700 Message-ID: Subject: Re: bug#49229: 27.2; `M-x shell' fails over TRAMP from local MS Windows To: Michael Albinus Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 49229 Cc: 49229@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On Sun, Jun 27, 2021 at 1:41 AM Michael Albinus wrote: > > But we could teach `read-file-name' to accept only remote file > names. What about this patch: > > > It is not perfect, one can still enter "/sudo::/bin/sh" when > `default-directory' is "/ssh::". But I wouldn't count this as mistake, > it would be rather a "user error by intention" :-) This seems like a reasonable compromise to me. Like you say, it's not perfect, but it should at least prevent users from mistakenly entering local paths here. From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 28 02:18:36 2021 Received: (at 49229-done) by debbugs.gnu.org; 28 Jun 2021 06:18:36 +0000 Received: from localhost ([127.0.0.1]:50748 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lxkbM-0000Iw-GT for submit@debbugs.gnu.org; Mon, 28 Jun 2021 02:18:36 -0400 Received: from mout.gmx.net ([212.227.17.21]:44097) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lxkbI-0000IZ-Is for 49229-done@debbugs.gnu.org; Mon, 28 Jun 2021 02:18:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1624861106; bh=u3FuO2yJRsq88t869iH8HL85qFsmRYE+RVx0fUz+JTc=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=HYyIQ18H98sCT0WhIscoGP6pFnZWwqjIqvpxqrrBqjvNH0oQD0SsaTY+9g/cRC19p O3ydnLRNjUngGbBNws+dqiwRgEXKe5iBrDuu20PJLUvXwCXK+AziKTUtqwJEvf62tX ff9RWcOXECmQz0cpoSZ3/L4sVuo1ZSWOol5THiqM= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from gandalf.gmx.de ([212.91.243.239]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MmULx-1lXB8i3RgX-00iXoX; Mon, 28 Jun 2021 08:18:25 +0200 From: Michael Albinus To: Jim Porter Subject: Re: bug#49229: 27.2; `M-x shell' fails over TRAMP from local MS Windows References: <87h7hkpufg.fsf@gmx.de> <87czs7pulr.fsf@gmx.de> Date: Mon, 28 Jun 2021 08:18:24 +0200 In-Reply-To: (Jim Porter's message of "Sun, 27 Jun 2021 17:47:49 -0700") Message-ID: <878s2upl5b.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:8U+e4z+47Hg/nJy7YitPWO7cOZsu3tZlxz9K8XqXd/ZjPpcXTnf uFR8qucG0OsMdWXVEQl0WKqoSXUv7YU1pkZ1Q/aP/slU4EHMV5MqyB3YDXD5agqfLF4sKaO Ur23xngDHd/zQLujWCQVlcSmp1j/HYBUl+Q5FqKLkYHTeG+hx3dPgeLUNtFePA8PH+qYJSt G8F1DhZq92uR9QZaz1IEw== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:4gNj8KaIgmM=:BZQHvgXTEYGsyWe3uqc1B1 jJs8DAVfH1E4qniIPVju/t6ihWbZOSDVR7uMjadD3sLHt8bLzjZbc1B5esMlb854Bcyj0QfXt oMjxgvsZM74hQh3p/bZeer38UaBXfuzfU0c31zPTlb/wfOMiaExgcLAbt7H+djA7YBpSZpBCF WLbaeYHA2RlSofYkuLRCRxCJX08bNisldLBlvAA2yHSh65qT+JsDcQnn2IJ5H0BZhhI9ELWWE qaVrOatdbmyuXi2CxE75LHuwv9lcAdybJPr1P9MjvFXIR7NdOV+qF/FO3zQL6idqa2ADlICo1 k4gFGtD8YFNv6LQXqtnKD5t0ZzmYHlU8YvnC/YFqsBOA1lgSlBncpxMtEeqrWWc2xnD1r/FI6 4vVWoxt17GC5NIIr8RWYQ4oHsNEv8nloe4envIOjQbKEuyHPk4M2MOEgSaxSGRfZkkinmAlXm 0pUrip072lLkzRlo4GaKxVbwqkuQEVVWJcMyzGs4Ah+galip8neOJHZ8174bxjQ2pmXG++mHR 1idtQHsAfIxiL2g0wPqjbNiVgi3gc0ZQeBBHVPYNHNWEoLrv3KwVugC0Q3KphR4XYKF5zkB1J D3zwfb1YKRyn+OlmE1Qi80AGmBCTpPor5xsgOzZV4iEMEr03oB55G8Up8mG2hMS75z82YE6nJ Fsq1NAsAqqjNY4fyqCEYhLdkV+9O7Xq0oXBC5r25Vc4b6mwKd3xdo+l8gbsz3ACYHW5eb9U0s LQC0hkeq390hjgkaz6huV9YrichECAYURd/XWjrmBeazMAfeaxAv9txesONj1nkXHjgd7fWOv p5NJvXNVpmhniBukNN29A8zAIqiEZf84+rw2dfnGkCd1C396ae3JFm01DpjmaXd6eiYPLyNGE WKlAQUT2pYnyPmvr1VaVUn+tOdGfc5YPAXV5q+eou3nstE5E+VdRGebnXQNNsYVSNfpQGCiik GB79kwEqFjkikM+7R5DjotZ9zKvDnJSjSfdpinc8OJamdmXEMreP0iP6wE1RtwIVeHArv0KKs k1K6BMTunH1kar7CR4NcoQOb9PIvXMeRF+PraOWQOmtGxV+XZnBmDTeF1v8UTBvpO+S47bGOC ILDBAhdcfmgOoIm0cjKRwZY/ppadz+UVELIkb+AJhqjjH/ypR0nBA4SOQ== X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 49229-done Cc: 49229-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Version: 28.1 Jim Porter writes: Hi Jim, > This seems like a reasonable compromise to me. Like you say, it's not > perfect, but it should at least prevent users from mistakenly entering > local paths here. I've pushed the patch to master, closing the bug. The Tramp part of the patch will appear with Tramp 2.5.1 on GNU ELPA. Best regards, Michael. From debbugs-submit-bounces@debbugs.gnu.org Thu Jul 01 13:08:10 2021 Received: (at 49229) by debbugs.gnu.org; 1 Jul 2021 17:08:11 +0000 Received: from localhost ([127.0.0.1]:33633 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lz0Ac-0008Dc-L4 for submit@debbugs.gnu.org; Thu, 01 Jul 2021 13:08:10 -0400 Received: from mail-pj1-f51.google.com ([209.85.216.51]:33735) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lz0Aa-0008DK-HZ for 49229@debbugs.gnu.org; Thu, 01 Jul 2021 13:08:09 -0400 Received: by mail-pj1-f51.google.com with SMTP id mn20-20020a17090b1894b02901707fc074e8so6216593pjb.0 for <49229@debbugs.gnu.org>; Thu, 01 Jul 2021 10:08:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=RpZRC2mlfBTtnWZrBHos674x6in1cjMZgYpUfH7W1KE=; b=lTKVqkMuoZATe2rOuBFQDrpKIqcraq1DjNvx0FEmT5PjF8qnkS5ESubOIk188A5ju+ /Si6W0s/U5x066bMIUA723XLP7MSsnFE+zVUKgfhYbSsFTeiCvgrFOxInDI1/rm0QLBh 5oF/2FGHhlft5ER6t12ZvxJkI2LR75tb+kBRZ8CkbhiLup/fRR7qtwBpNQa70RdAsWLq k5UOE5lvmBpYkQIkVAM4LP2R8840zJOkO9xWOz7hCkhZDYd1MxTkT3Cc1O8DkBPou8yC lcal+XAZhr40K/QlpofXDp3D6qJvI33hqpKS+tXcYe/0H0n7X1wxz6N3TxBsL3XmDvkI 1u3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=RpZRC2mlfBTtnWZrBHos674x6in1cjMZgYpUfH7W1KE=; b=HeG8V6RluJlXIw1revyCEELxlyboMldnS8HetmodVlCx9MpHdjPTwc9WQ4wwkPgGl6 StJXwWDduhHlju3mu+Fqkzqp1SQ3vBJkPxUxtlBD9Xpb9rpNmgGMZC9SY77oubX9fG4p jZZbLrFczXDkOV5SRp8rOmrQpYLJntETviwrNGlAejVtB/UgJZwLLFNtuLQSNIW8Sr1b 49Szzeqefb6jTh2b0r261v/tH1HYaiwZ1/+xYoXuzWqY9T+ayFl1A+ww+uJEL7XNEOP7 jlPzdXgQbxzBnXOTloZcgItyIHRDNFIm1NNnEoQhOHAseuSZScmixq06sXp/24QoTDmX WE+w== X-Gm-Message-State: AOAM531SO8311cHd8uplvUva5rylqvnxN0obd23C/3UekVmAh+91Lgqx FWlkE/F5SXhNUjSqk4VZ2mUZzG6OGT0fvdoexbE= X-Google-Smtp-Source: ABdhPJwMeNpYTZO9OoENunyXJMQP80ks3wAFGmjMwSvk8zBaIvI86lZJ94BnY5dWzK+XgA7u8VAmKYRqnzhz+Fo0f6U= X-Received: by 2002:a17:902:dac2:b029:125:d557:cf55 with SMTP id q2-20020a170902dac2b0290125d557cf55mr593986plx.60.1625159282858; Thu, 01 Jul 2021 10:08:02 -0700 (PDT) MIME-Version: 1.0 References: <87h7hkpufg.fsf@gmx.de> <87czs7pulr.fsf@gmx.de> <878s2upl5b.fsf@gmx.de> In-Reply-To: <878s2upl5b.fsf@gmx.de> From: Jim Porter Date: Thu, 1 Jul 2021 10:07:53 -0700 Message-ID: Subject: Re: bug#49229: 27.2; `M-x shell' fails over TRAMP from local MS Windows To: Michael Albinus Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 49229 Cc: 49229@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) (Hopefully I don't need to do anything special to comment on a closed bug...) On Sun, Jun 27, 2021 at 11:18 PM Michael Albinus wrote: > > I've pushed the patch to master, closing the bug. The Tramp part of the > patch will appear with Tramp 2.5.1 on GNU ELPA. I discovered a minor issue with the Tramp part of the patch. On MS Windows, if I'm editing a remote file and then open a local file, the newly-opened local file's default directory doesn't have a volume letter. This still works overall, but it does break the "~" file alias. Here are steps to reproduce: C-x C-f /sshx:server:/path/to/file.txt ;; "/sshx:server:/path/to/" is pre-filled here: C-x C-f /sshx:server:/path/to//~/local.txt ;; local.txt opens/saves correctly, but... C-x C-f ;; Initial value in minibuffer is "/Users/Jim/Documents/". ;; Before Tramp 2.5.1, it was "~/". This might cause some problems in other places, but so far the only issue I've found is the file alias for "~" no longer working. However, the fact that `default-directory' for local.txt isn't an absolute path could cause issues if we use that `default-directory' elsewhere. Since "/Users/Jim/Documents/" is relative to the current drive, it can mean different things depending on what Emacs thinks the current drive is at the time. Maybe it would be best to revert the Tramp part of this patch and do something similar to the patch in my original message. That would ensure that nothing unexpected happens as a result of `default-directory' being relative to the current drive. If that makes sense, I can put together a proper patch for the `M-x shell' part. From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 02 08:58:59 2021 Received: (at 49229) by debbugs.gnu.org; 2 Jul 2021 12:58:59 +0000 Received: from localhost ([127.0.0.1]:35245 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lzIl0-0007Kn-VN for submit@debbugs.gnu.org; Fri, 02 Jul 2021 08:58:59 -0400 Received: from mout.gmx.net ([212.227.15.19]:40545) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lzIkw-0007KV-CH for 49229@debbugs.gnu.org; Fri, 02 Jul 2021 08:58:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1625230727; bh=BumTevt8rPfNYIk+KcEprq4zqBmHV9eXvhcvDOUGzMA=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=BPtOQtU++DXKs3FwVyO+5XVq0Az61kAgp4Dk7SfOV/Rr8sHpJg70ep3cIjdyVXpNH UMw/tWMXvJDcYReqNN8XivfUC70SGI+Xcm8F4rQ2h9rWkYEIgz3kQmYnszhsMUXxzY /egG+TvlWb7wLXp30dic3LFiUk2ne0vru5gcja5w= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from gandalf.gmx.de ([79.140.124.21]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1Mn2W5-1lX9960ZL5-00k3xd; Fri, 02 Jul 2021 14:58:47 +0200 From: Michael Albinus To: Jim Porter Subject: Re: bug#49229: 27.2; `M-x shell' fails over TRAMP from local MS Windows References: <87h7hkpufg.fsf@gmx.de> <87czs7pulr.fsf@gmx.de> <878s2upl5b.fsf@gmx.de> Date: Fri, 02 Jul 2021 14:58:46 +0200 In-Reply-To: (Jim Porter's message of "Thu, 1 Jul 2021 10:07:53 -0700") Message-ID: <878s2ox46x.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Provags-ID: V03:K1:G/ISoiGiZX+rFp/psVbq9TbUtCxP0ANSTPd8Sb+UBC6CPMKjd7y qhsj660Y7ksKFG17ledrnOcfrpAmMGFTnzN8JOiMyUPJfzqfGKCtgwWRazce9sPpjqW1PTG B6NwwQp0iYcWpVb4hco57S/JJh3xnMI6cfFp0VmL4nH4amJDMqb2gbM55ipo/rrXIo6kPY7 8yY8Hn02z+VtbaHmtsS7Q== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:aEGLEwVNE+A=:8Kirlpc+WVVZmRmgEAlRep K1V7bXNi4RHxwkTzsqZAvZoyvJgWSxmSjyIbvQOET/R1eLsrbaRnFuDWv1gJ44cPRA95ivrec f12lu5AMjGDdXWKQevXVAZ/THixy+GqylTWQ3WXBGS4WoL7Y1rnBNhVpsNUxbKKKnuE9tR7G2 D8jdrZ0JL7avqMvbqvAzWpdiZ/ANG9t3dKWv8lg+mwWQBcq7ivxPVZuPUrIoPVd3aFdRC3pIU Lxw6xtoc4PM3lGVZxJh0hrK57N9GYiE+dAawGTRv2+4+EmB/zQXS4c7NNrn6YyYE8lXI5Wc9v 0PT6HU5yWZJgmYBjYQczlocb/l37GXpfLU+tzeEeu+6dwCeo8gylGCuD1bpRZGXsNDZ+/IcpV xHzLMGWRlgkNx80qQ4/alIxlJnm2ZBkRm/vninggU7l45rdOg6ctESw4h4mzrUzBLpJcq2mnM XhlRrEcs4VYMJz1hMli+d0M/7U0S0n2L9QMiEOT9ENZ+wzsnonNOZXsXJsQ4i0x8FmCcBrqAc DKns0o4mccI/SiDo/737d7YX+a0H04303juxSHuEillLsokXkfELr+D/RYsTa5M1+ImkNFEl6 Id6YTPpfC/+qnJlFsJPIjaE7zrtpRue5GM/eQYIOIM3txQryin1xEv6XOpQ4c0e3b9okq8P3K +OkcL0DpNoD3YVo2WK+7tPju0L9WsRdxTccDLt1oCFo7fIUYzgKQusFvScifeGubVDBbKadLf SXgCEFPO4H3fiOBJpv9PtTHHVSisRXAvLUcSaqxeUjMcd/rPNKv1PGIe1OG1soUhRkjjxZviM qC4MxwKZ2a3UFS1kJpMpWy5vQS7h6RphUBlV9DFlV8dx1BIQ9Q4WNRLeBFGus0w04k091pPMh j4TOIbqrj5+Q8xpco7a25PiC+CXKCmFlDbnrj4D7GFPLzJgN+/EVaO5EZ3VzDeE91SsthtCz7 KAhWU3lMO+JKZdY9PFn7y1GgUKHBYr/Zl5qsQJ79WyL4Y4DULCGhU55m8Co0xECGC2R07J18C uTqAue1yUuPpOHYqF2Leaz6UQWFaw4v5VuhtEgseuVPhdWgTNBeYshRg2yn1OL157lHprO5dK G8KQL6B6juqRodSCTMp/ua7glgIHw0wTfQSks96KFHhfLX/NGN+dvP4GQ== X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 49229 Cc: 49229@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --=-=-= Content-Type: text/plain Jim Porter writes: Hi Jim, > (Hopefully I don't need to do anything special to comment on a closed bug...) No problem, > Maybe it would be best to revert the Tramp part of this patch and do > something similar to the patch in my original message. That would > ensure that nothing unexpected happens as a result of > `default-directory' being relative to the current drive. If that makes > sense, I can put together a proper patch for the `M-x shell' part. As I've said in my reply, I believe the problem is more general, and not restricted to just the `shell' function. So I have pushed a patch to master, which reverts my Tramp change, and which adds the following change to `read-file-name-default' of minibuffer.el: --=-=-= Content-Type: text/x-patch Content-Disposition: inline Content-Transfer-Encoding: quoted-printable *** /tmp/ediffZeoKgh 2021-07-02 14:52:22.462303385 +0200 =2D-- /home/albinus/src/emacs/lisp/minibuffer.el 2021-07-02 14:50:37.71633= 8781 +0200 *************** *** 3161,3166 **** =2D-- 3161,3167 ---- (unless val (error "No file name specified")) (if (and default-filename + (not (file-remote-p dir)) (string-equal val (if (consp insdef) (car insdef) insde= f))) (setq val default-filename)) (setq val (substitute-in-file-name val)) --=-=-= Content-Type: text/plain Could you, pls, test? Best regards, Michael. --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 02 17:31:19 2021 Received: (at 49229) by debbugs.gnu.org; 2 Jul 2021 21:31:19 +0000 Received: from localhost ([127.0.0.1]:37253 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lzQkp-0002QX-AA for submit@debbugs.gnu.org; Fri, 02 Jul 2021 17:31:19 -0400 Received: from mail-pg1-f179.google.com ([209.85.215.179]:46985) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lzQkl-0002QI-L7 for 49229@debbugs.gnu.org; Fri, 02 Jul 2021 17:31:18 -0400 Received: by mail-pg1-f179.google.com with SMTP id w15so10964203pgk.13 for <49229@debbugs.gnu.org>; Fri, 02 Jul 2021 14:31:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=kMrbSHTTuXYg5rGRm3c0ubbbSw583G2updt0CvIbfU8=; b=RbkFASvuE0CdiBwunYCcYb2XJCa251IkLqJBulcN0YldYShEERpGD24Ee/nRGf837b MOihHlF9nlUKgu5RTW+CP+FGh0KNpjTrttdm7GgLAvYDlaF5z4i5HbHcuuwuswrj0U9S Q1l3o9VQUsuhi284P1yy2jbXBcMcv+s5PMfhtwvsnLFArHn4zhs6M3F/y4HjJoyCW1sP 1xdDteICk//0Km90oxcdS8fRP3ItwdkdYuwO7wtDEHYtCaWr+qhX4cCh0uu+fMn46SMV V1BssgM9kUwIPOg9DjNtfzwtVw3z4Ng/8oVsAFgNLwxzCcIEDA5zrFYta0CrKnwRANmh kcbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=kMrbSHTTuXYg5rGRm3c0ubbbSw583G2updt0CvIbfU8=; b=Fa1HSDb/CUgTOE65xvLs3kvAz/YyrUPCBFtwpmFCW1SXbSMHk8JGdYIr4pPjuGeJ+W veEWbNup3iGsRFgyolhuwnkO70wf6zeP2Tv1aJjuy/TAA2iv4qWD0O7zilSiW8W3KNvK V1ParxPnxXFyQGNr9NAPXI6r8rjmRqi65qHPdD2R3h4mtH+afUZC+fJGzMna6m78aBZ9 PMYNWLiOMttadWryLVW+XtdVSD2P6aoZ7DDqu/Wfq6Qe+6LsGxKHshLmpm45brXXrZZR 8sGRlHoELsHNXbnoSBRN8xVQdhoy40xF52fYmPB8uUQVKcShzrhsNV3t41O6B/aI3hRM kpqg== X-Gm-Message-State: AOAM533+Wn/QcTqUM1ddGjWixj4WbusUONG/xrSOkQyKSsTtYTI5lOSx zq3hAviPqEI/RuM/vk7WT4IVATwCeTtibLiGMBM= X-Google-Smtp-Source: ABdhPJxpHtKz4bh11jbyDHr1GvYxkqwdymGT5i36SxZENOGuEgn7PBoTLugC26fke94Uui77J3RSkYgmp8JT95SjPBA= X-Received: by 2002:aa7:9464:0:b029:306:3984:b22a with SMTP id t4-20020aa794640000b02903063984b22amr1545177pfq.81.1625261469906; Fri, 02 Jul 2021 14:31:09 -0700 (PDT) MIME-Version: 1.0 References: <87h7hkpufg.fsf@gmx.de> <87czs7pulr.fsf@gmx.de> <878s2upl5b.fsf@gmx.de> <878s2ox46x.fsf@gmx.de> In-Reply-To: <878s2ox46x.fsf@gmx.de> From: Jim Porter Date: Fri, 2 Jul 2021 14:30:59 -0700 Message-ID: Subject: Re: bug#49229: 27.2; `M-x shell' fails over TRAMP from local MS Windows To: Michael Albinus Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 49229 Cc: 49229@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On Fri, Jul 2, 2021 at 5:58 AM Michael Albinus wrote: > > As I've said in my reply, I believe the problem is more general, and not > restricted to just the `shell' function. > > So I have pushed a patch to master, which reverts my Tramp change, and > which adds the following change to `read-file-name-default' of minibuffer.el: > > > Could you, pls, test? Thanks for the fix. I tested this both by running `M-x shell' from a remote buffer and by opening a local file while in a remote buffer and both of these work as expected. Note that I just eval'ed the updated functions in my Emacs 27.2 instance, so it's not a *perfect* test; still, hopefully it's enough to verify that this works correctly. From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 03 02:42:52 2021 Received: (at 49229) by debbugs.gnu.org; 3 Jul 2021 06:42:52 +0000 Received: from localhost ([127.0.0.1]:37829 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lzZMa-00015Z-27 for submit@debbugs.gnu.org; Sat, 03 Jul 2021 02:42:52 -0400 Received: from mout.gmx.net ([212.227.15.15]:52133) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lzZMX-00015I-SZ for 49229@debbugs.gnu.org; Sat, 03 Jul 2021 02:42:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1625294563; bh=3UshKSpTKc+za1vCC728CM59UIz7RWRKi1+a11Mgapg=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=W8lhzGPJglIlsM8bWgp4a1Al91rkwXxiARduYNnXdH/RFMzO5suO6YoxZkWk+jKZ4 9c6v0IqNqdZoc7o8GX9MviWTF2bI6NtdmQQjuYDnM759kUfob3gglP26o9TiZg2CEW Ew8ShOYply4yWxCZ3+qmNJVjOTculpzQbZf8r6fE= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from gandalf.gmx.de ([212.91.242.253]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MxDkw-1lFbUA3GB6-00xYR4; Sat, 03 Jul 2021 08:42:42 +0200 From: Michael Albinus To: Jim Porter Subject: Re: bug#49229: 27.2; `M-x shell' fails over TRAMP from local MS Windows References: <87h7hkpufg.fsf@gmx.de> <87czs7pulr.fsf@gmx.de> <878s2upl5b.fsf@gmx.de> <878s2ox46x.fsf@gmx.de> Date: Sat, 03 Jul 2021 08:42:41 +0200 In-Reply-To: (Jim Porter's message of "Fri, 2 Jul 2021 14:30:59 -0700") Message-ID: <87tulbyk2m.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:mHTgrU0NZOLd9CVY2eGAsxMeLbJ7rgXFEJY1b6vwnA2AFaGBLAg WShZa6Qjkq27rZLQsjmlq2Nq57bjqjdakvyHQHDQOCoA3WxH+KtOVc8OZ3snErD4Oe5PTWS iPzKl2xpr5jbuCmodOhHJWiYw97/B5fpmtkoLM8g6oOqL6duO02icHqmn6QjdUujK5Mt8ZP 2+cvEusM2dwVnWqUFI6UA== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:lQcvkhuIuNM=:6VLM1Y/PxKvhixRRPj77Z4 Dl9kN9BVYWuI8/ap4HlYnQpNVzDRgXYjWkL4daIwLkefunnV+PsxLo817B95CgwyJ2vGmlp1V GGFv5alqf0j2GoXKdGgm/v5q/O7G6BOuiNMb2VsoVKM9RuPUdphiT2Wre+r6dEr3w88OHFq0i dAw5KfhHn6fB1Rc9cGS/nwk1K/D+ia2BT5TVN/t1VoTeIIUJKg8OwQb66UpvNphAG9n5V2uzB /2G8TCMPHYW68jtctsjBWAnq/SCD8sAavkfIV0FXB0tP+8I9BvjNCBiCb376oDeYp1tSVTSK5 mAl52jRBeCLttC6t/fwrhvwWIY85gtyBf4A090u/yi0uJL4ZWU5s6amXJi01Db6WM/AjcctBc BZ/p6bwFZvuPofrYe2mc7hXa4fbmJ7hjp21L3iiPR+zASzTUZUjNyeLjBpNu0k/X4/Bbl0LVo roUEGMTHCqlu9cJFADO4R1IK6dLf4O/op3dohbvcVO8aWsp2pQ6Wnado5jScAACZA+EZgcl5l oK4/XMHTkI5p2aMFjwqpOvfH3+vJ3ZDKVS5kvh1yGN+0kBrqEiOI9cOFFkcWQfYl1EHs+Bm2N kKinK1W0QUM0fupqiQGBTUFBCx9ISujkmUkyDHUqrkfakEBP95iZYespFM7B/w6tIOenG6gf5 eiaEhliHdm0/QXyBRVG6OdLYvOhDo53LtcTHH8r13L7FGQ9CxSxdwg8Ge6UUu/LHsUk7t5xcy gG/yIJGyjw6rItwhT2f0lwQhpS+1GkHSXqh2AVL/MwfevzGdpZN2a3OnmnvgqdinNEqMTIuTR TrCq4ivvrOa4qqBgqV4SL+aJ2tn+q6PPtSSTITjVeEiTK5If3bpJwq9PTGjjMJVfTzCP3rif1 veiK0o196y/uBmIXYBEyXRKDUDmdCQODHFUTGHt0djQ3AmE8uAITnIw83lHzXmofN+K5my1Rh k6QTHDfuVHS0bdOSzgb5xpGpMp6ssrE7jGIkULgnTDtcV070S2dxx8n1roXHfyLGVaEGKScXP u/8WZimEO3DU/PENwkAG6ONXcK+igxpEWs4RKbrfIMDgUFi7cSmLfhWw6C2H7TVLnJfSuuAqT Q6hdw2E+Xos8GJrRHyvepGV8ADxG1mVd7VY6ax1B2uKmIFt6fu1dC4+RA== X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 49229 Cc: 49229@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Jim Porter writes: Hi Jim, > Thanks for the fix. I tested this both by running `M-x shell' from a > remote buffer and by opening a local file while in a remote buffer and > both of these work as expected. Note that I just eval'ed the updated > functions in my Emacs 27.2 instance, so it's not a *perfect* test; > still, hopefully it's enough to verify that this works correctly. Thanks for confirmation. The Tramp part of the patch will appear with the next Tramp ELPA release, likely 2.5.1.1. Best regards, Michael. From unknown Fri Jun 20 07:27:53 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 31 Jul 2021 11:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator