unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: help-gnu-emacs@gnu.org
Subject: Re: tramp and shell, problem on windows 7
Date: Sat, 04 Nov 2017 16:40:40 +0200	[thread overview]
Message-ID: <83lgjmt8d3.fsf@gnu.org> (raw)
In-Reply-To: <87lgjmgny3.fsf@gmx.de> (message from Michael Albinus on Sat, 04 Nov 2017 14:42:28 +0100)

> From: Michael Albinus <michael.albinus@gmx.de>
> 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?



  reply	other threads:[~2017-11-04 14:40 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-04  8:42 tramp and shell, problem on windows 7 Shuguang Sun
2017-11-04 13:42 ` Michael Albinus
2017-11-04 14:40   ` Eli Zaretskii [this message]
2017-11-04 15:25     ` Michael Albinus
2017-11-04 15:48       ` Eli Zaretskii
2017-11-04 15:46     ` Why are bugs discussed on this list? [was: tramp and shell ...] tomas
2017-11-04 16:13       ` Eli Zaretskii
2017-11-04 16:19         ` tomas
2017-11-05  3:08   ` tramp and shell, problem on windows 7 Shuguang Sun

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83lgjmt8d3.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).