From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#24984: Antw: Re: Antw: Re: bug#24984: Emacs 25.1.1: Problems with file completion in Windows shell Date: Fri, 25 Nov 2016 10:58:08 +0200 Message-ID: <83mvgo3pi7.fsf@gnu.org> References: <58341A00020000A10002358B@gwsmtp1.uni-regensburg.de><58341A00020000A10002358B@gwsmtp1.uni-regensburg.de> (Ulrich.Windl@rz.uni-regensburg.de) <834m2z8qgw.fsf@gnu.org> <58355F63020000A1000235CE@gwsmtp1.uni-regensburg.de><58355F63020000A1000235CE@gwsmtp1.uni-regensburg.de> (Ulrich.Windl@rz.uni-regensburg.de) <83a8co6b28.fsf@gnu.org> <58376442020000A10002360F@gwsmtp1.uni-regensburg.de><58376442020000A10002360F@gwsmtp1.uni-regensburg.de> (Ulrich.Windl@rz.uni-regensburg.de) <83y4083ubg.fsf@gnu.org> <5837FD3D020000A10002361A@gwsmtp1.uni-regensburg.de> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1480064362 11245 195.159.176.226 (25 Nov 2016 08:59:22 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 25 Nov 2016 08:59:22 +0000 (UTC) Cc: 24984@debbugs.gnu.org To: "Ulrich Windl" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Nov 25 09:59:15 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cACLh-0001ky-Gg for geb-bug-gnu-emacs@m.gmane.org; Fri, 25 Nov 2016 09:59:13 +0100 Original-Received: from localhost ([::1]:44728 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cACLl-0007fk-7x for geb-bug-gnu-emacs@m.gmane.org; Fri, 25 Nov 2016 03:59:17 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52370) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cACLa-0007fQ-He for bug-gnu-emacs@gnu.org; Fri, 25 Nov 2016 03:59:10 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cACLW-0001uc-6k for bug-gnu-emacs@gnu.org; Fri, 25 Nov 2016 03:59:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:53864) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cACLW-0001uM-3K for bug-gnu-emacs@gnu.org; Fri, 25 Nov 2016 03:59:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cACLV-0007Xq-QH for bug-gnu-emacs@gnu.org; Fri, 25 Nov 2016 03:59:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 25 Nov 2016 08:59:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24984 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 24984-submit@debbugs.gnu.org id=B24984.148006431628968 (code B ref 24984); Fri, 25 Nov 2016 08:59:01 +0000 Original-Received: (at 24984) by debbugs.gnu.org; 25 Nov 2016 08:58:36 +0000 Original-Received: from localhost ([127.0.0.1]:41030 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cACL2-0007X6-Kf for submit@debbugs.gnu.org; Fri, 25 Nov 2016 03:58:36 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:33034) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cACL1-0007Wt-1c for 24984@debbugs.gnu.org; Fri, 25 Nov 2016 03:58:31 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cACKp-0001EH-K1 for 24984@debbugs.gnu.org; Fri, 25 Nov 2016 03:58:25 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:57661) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cACKp-0001E3-G7; Fri, 25 Nov 2016 03:58:19 -0500 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2113 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1cACKo-0003S4-1I; Fri, 25 Nov 2016 03:58:18 -0500 In-reply-to: <5837FD3D020000A10002361A@gwsmtp1.uni-regensburg.de> (Ulrich.Windl@rz.uni-regensburg.de) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:126072 Archived-At: [Please keep the bug address on the CC list.] > Date: Fri, 25 Nov 2016 08:58:37 +0100 > From: "Ulrich Windl" > > >> This nasty bug makes shell-mode practically unusable; why do you suggest to > > close the bug? > > > > Because it isn't a bug in Emacs, it's a user error: cmd.exe requires > > such names to be quoted. Am I missing something here? > > Yes (reproduction): > c:\Users\Ulrich Windl>cd .. > cd .. > > c:\Users>cd Ulrich Windl/ ### completed from Ul (where is the TAB key being pressed) > cd Ulrich Windl/ ### the command produced by Emacs is without quotes! > > c:\Users\Ulrich Windl>cd Do ### 1: The chdir seems to have succeeded (see prompt) > ### "Do" does not list any completions, because EMacs thinks the directory is different. > c:\Users\Ulrich Windl>cd U ### lets complete Emacs to "Ulrich Windl" again, because it thinks the directory is "C:\Users" > ### When executing the "cd", it failes, od course: > c:\Users\Ulrich Windl>cd Ulrich Windl/ > cd Ulrich Windl/ > Das System kann den angegebenen Pfad nicht finden. > > ### So the shell does things correctly, but Emacs does not. So you expect Emacs to quote such file names automatically? Note that the Windows cmd.exe shell does it automatically only in some cases. For example: C:\>cd Docu TAB produces C:\>cd "Documents and Settings" as you'd expect, but C:\>cd Documents and Settings\My TAB does not, it simply fails to complete. Instead, you need to type this: C:\>cd "Documents and Settings\My TAB i.e. start the file name with a quote. So there's no consistency in what the shell does here, either. > Specifically if EMacs completes a name containing a space without putting quotes around, you cannot complein the shell for it (Compare to BASH: It does the quoting correctly is such a case) What I see in "M-x shell" with Bash (on a GNU/Linux system) is not entirely correct either: $ cd /home/e/eliz/foo TAB produces $ cd /home/e/eliz/foo\ bar\ baz/ which is correct. But $ cd '/home/e/eliz/foo TAB produces this: $ cd '/home/e/eliz/foo\ bar\ baz/' bash: cd: /home/e/eliz/foo\ bar\ baz/: No such file or directory If you try the same from the Bash command line, it does work correctly: Bash completes "'foo " into "'foo bar baz'/", with the closing quote and the slash added. So my conclusion is that completion of such file names in "M-x shell" does not work reliably on Posix hosts, either. I'm okay with leaving this bug report open, with its subject retitled "Completion of file names with embedded white space is broken in 'M-x shell'", if you agree with my analysis. Thanks.