From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.help Subject: Re: tramp and shell, problem on windows 7 Date: Sat, 04 Nov 2017 16:40:40 +0200 Message-ID: <83lgjmt8d3.fsf@gnu.org> References: <87lgjmgny3.fsf@gmx.de> NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1509806471 1819 195.159.176.226 (4 Nov 2017 14:41:11 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 4 Nov 2017 14:41:11 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Nov 04 15:41:04 2017 Return-path: Envelope-to: geh-help-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 1eAzdA-0008Jt-A0 for geh-help-gnu-emacs@m.gmane.org; Sat, 04 Nov 2017 15:41:04 +0100 Original-Received: from localhost ([::1]:41195 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eAzdH-0002wZ-Hp for geh-help-gnu-emacs@m.gmane.org; Sat, 04 Nov 2017 10:41:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42003) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eAzcq-0002wT-Ki for help-gnu-emacs@gnu.org; Sat, 04 Nov 2017 10:40:45 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eAzcm-0006SD-M6 for help-gnu-emacs@gnu.org; Sat, 04 Nov 2017 10:40:44 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:46256) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eAzcm-0006S7-Ix for help-gnu-emacs@gnu.org; Sat, 04 Nov 2017 10:40:40 -0400 Original-Received: from [176.228.60.248] (port=4154 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1eAzcl-0004D9-Vg for help-gnu-emacs@gnu.org; Sat, 04 Nov 2017 10:40:40 -0400 In-reply-to: <87lgjmgny3.fsf@gmx.de> (message from Michael Albinus on Sat, 04 Nov 2017 14:42:28 +0100) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:114738 Archived-At: > From: Michael Albinus > Date: Sat, 04 Nov 2017 14:42:28 +0100 > Cc: help-gnu-emacs@gnu.org > > > Windows7, > > GNU Emacs 27.0.50 (build 1, x86_64-w64-mingw32) of 2017-10-21 > > I don't use Windows myself, so I can guess only. [Why are bugs discussed on this list?] > > - Problem 1: tramp and dired-do-shell-command: start: Unknown job: /b > > Why "start /b" is called remote side? > > Internally, `shell-command' will be called. This uses `shell-file-name' > and `shell-command-switch'. I suppose, both variables are set to "start" > and "/b", respectively, in your environment. > > > When I run tramp (plink) and go to a remote buffer (dired mode), run > > dired-do-shell-command (!) on marked file (for example, R CMD BATCH * &). > > It popup the buffer of * Async Shell Command *, and the command is not run > > but a message "start: Unknown job: /b" which looks it runs the windows-like > > command "start /b ..." on the remote shell. > > You will be served better if you set `explicit-shell-file-name' to a > proper value, for example "/bin/sh". See the discussion in the Emacs > manual, node "Interactive Subshell". I don't think this is right. First, "start /b" comes from dired-shell-stuff-it, and should be used on MS-Windows, and only when the shell command ends in "&", as the user did in this case. I think the problem here is that we don't distinguish between the local and the remote case, and use local logic for the remote case. And second, I don't recommend users to set explicit-shell-file-name, as that makes Emacs use a shell that might be different from the one used by the system. Users who do this should know very well what they are doing, because it could get them in trouble. > > - Problem 2: tramp and shell: env: c:/bin/ : No such file or directory > > where "c:/" comes? > > > > In a tramp dried buffer, call shell which suppose to raise the shell buffer > > on remote server. However, I got error messge in the * shell * buffer that > > "env: c:/bin/ : No such file or directory". I don't know where the "c:/" > > comes from. When shell is called, it reads the remote path in the minibufer > > with promotes > > "/plink:user@host:/path/to/dired/C:/Users/username/emacs/libexec/emacs/27.0.50/x86_64-w64-mingw32/cmdproxy.exe", > > and I change it to "/plink:user@host:/bin/", and then I got error message > > above. Below is the tracking: > > This I cannot answer (yet). Try the setting above, and let's see what's > happening. I think the first question here is why do we see cmdproxy there. On Windows, shell-file-name is set to cmdproxy, but why does Tramp use that value?