all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* tramp and shell, problem on windows 7
@ 2017-11-04  8:42 Shuguang Sun
  2017-11-04 13:42 ` Michael Albinus
  0 siblings, 1 reply; 9+ messages in thread
From: Shuguang Sun @ 2017-11-04  8:42 UTC (permalink / raw)
  To: help-gnu-emacs

Hi all,

Windows7,
GNU Emacs 27.0.50 (build 1, x86_64-w64-mingw32) of 2017-10-21

- Problem 1: tramp and dired-do-shell-command:  start: Unknown job: /b
Why "start /b" is called remote side?

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.

- 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:

Searching for
‘C:/Users/username/emacs/libexec/emacs/27.0.50/x86_64-w64-mingw32/cmdproxy.exe’....
Tramp: Opening connection for user@host using plink...
Tramp: Sending command ‘plink -l user  -ssh host && exit || exit’
Tramp: Waiting for prompts from remote shell...
Tramp: Sending password
Tramp: Waiting for prompts from remote shell...done
Tramp: Found remote shell prompt on ‘host’
Tramp: Opening connection for user@host using plink...done


Best Regards,
Shuguang Sun


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: tramp and shell, problem on windows 7
  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
  2017-11-05  3:08   ` tramp and shell, problem on windows 7 Shuguang Sun
  0 siblings, 2 replies; 9+ messages in thread
From: Michael Albinus @ 2017-11-04 13:42 UTC (permalink / raw)
  To: Shuguang Sun; +Cc: help-gnu-emacs

Shuguang Sun <shuguang@gmail.com> writes:

> Hi all,

Hi,

> 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.

> - 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".

> - 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.

> Best Regards,
> Shuguang Sun

Best regards, Michael.



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: tramp and shell, problem on windows 7
  2017-11-04 13:42 ` Michael Albinus
@ 2017-11-04 14:40   ` Eli Zaretskii
  2017-11-04 15:25     ` Michael Albinus
  2017-11-04 15:46     ` Why are bugs discussed on this list? [was: tramp and shell ...] tomas
  2017-11-05  3:08   ` tramp and shell, problem on windows 7 Shuguang Sun
  1 sibling, 2 replies; 9+ messages in thread
From: Eli Zaretskii @ 2017-11-04 14:40 UTC (permalink / raw)
  To: help-gnu-emacs

> 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?



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: tramp and shell, problem on windows 7
  2017-11-04 14:40   ` Eli Zaretskii
@ 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
  1 sibling, 1 reply; 9+ messages in thread
From: Michael Albinus @ 2017-11-04 15:25 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: help-gnu-emacs

Eli Zaretskii <eliz@gnu.org> writes:

> 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.

Hmm. The documentation recommends its use, see
(info "(emacs) Interactive Shell")

And the Tramp manual explains how to set it differently for every remote
host, see (info "(tramp) Remote processes")

What else do you recommend on remote systems?

> 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?

I could try to dig, if I get traces produced by (setq tramp-verbose 6)
But this tells only the Tramp part of the story. I suspect, we are faced
with settings outside Tramp.

Best regards, Michael.



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Why are bugs discussed on this list? [was: tramp and shell ...]
  2017-11-04 14:40   ` Eli Zaretskii
  2017-11-04 15:25     ` Michael Albinus
@ 2017-11-04 15:46     ` tomas
  2017-11-04 16:13       ` Eli Zaretskii
  1 sibling, 1 reply; 9+ messages in thread
From: tomas @ 2017-11-04 15:46 UTC (permalink / raw)
  To: help-gnu-emacs

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Sat, Nov 04, 2017 at 04:40:40PM +0200, Eli Zaretskii wrote:

[...]

> [Why are bugs discussed on this list?]

Eli, you are an exceedingly smart person (I say that without
a whiff of irony). But you haven't walked in a greenhorn's
shoes (definitely not wrt. Emacs) for quite a long time.

For us mere mortals it is sometimes hard to distinguish
between PEBKAC[1] and a genuine bug. That's why we (cautiously)
turn first to this list, perhaps once too often

Be gentle :)

Cheers

[1] Problem Exists Between Keyboard And Chair. Always assume
   this first.

- -- tomás
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEARECAAYFAln94NUACgkQBcgs9XrR2kZ1DQCeKT+u+yytsMllRN5Mk6vnl82Z
rLIAnj/TueyFmo0aBAHIFDrTx5qnvDr+
=jpXH
-----END PGP SIGNATURE-----



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: tramp and shell, problem on windows 7
  2017-11-04 15:25     ` Michael Albinus
@ 2017-11-04 15:48       ` Eli Zaretskii
  0 siblings, 0 replies; 9+ messages in thread
From: Eli Zaretskii @ 2017-11-04 15:48 UTC (permalink / raw)
  To: help-gnu-emacs

> From: Michael Albinus <michael.albinus@gmx.de>
> Cc: help-gnu-emacs@gnu.org
> Date: Sat, 04 Nov 2017 16:25:43 +0100
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> > 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.
> 
> Hmm. The documentation recommends its use, see
> (info "(emacs) Interactive Shell")

That recommendation is for "M-x shell", not for shell-command and its
Dired derivatives.  For "M-x shell", the recommendation makes sense,
because the user should have control on what shell is run in
interactive sessions.  But shell-command is an entirely different
matter.

> And the Tramp manual explains how to set it differently for every remote
> host, see (info "(tramp) Remote processes")
> 
> What else do you recommend on remote systems?

explicit-shell-file-name is not for remote systems.  I was only
talking about setting this for shell-commands executed locally.

> > 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?
> 
> I could try to dig, if I get traces produced by (setq tramp-verbose 6)
> But this tells only the Tramp part of the story. I suspect, we are faced
> with settings outside Tramp.

You may be right.



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Why are bugs discussed on this list? [was: tramp and shell ...]
  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
  0 siblings, 1 reply; 9+ messages in thread
From: Eli Zaretskii @ 2017-11-04 16:13 UTC (permalink / raw)
  To: help-gnu-emacs

> Date: Sat, 4 Nov 2017 16:46:29 +0100
> From: <tomas@tuxteam.de>
> 
> Eli, you are an exceedingly smart person (I say that without
> a whiff of irony). But you haven't walked in a greenhorn's
> shoes (definitely not wrt. Emacs) for quite a long time.
> 
> For us mere mortals it is sometimes hard to distinguish
> between PEBKAC[1] and a genuine bug. That's why we (cautiously)
> turn first to this list, perhaps once too often
> 
> Be gentle :)

I only ask these questions veteran contributors to Emacs who are quite
able to distinguish bugs from cockpit errors.

Please be gentle with me as well.



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Why are bugs discussed on this list? [was: tramp and shell ...]
  2017-11-04 16:13       ` Eli Zaretskii
@ 2017-11-04 16:19         ` tomas
  0 siblings, 0 replies; 9+ messages in thread
From: tomas @ 2017-11-04 16:19 UTC (permalink / raw)
  To: help-gnu-emacs

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Sat, Nov 04, 2017 at 06:13:52PM +0200, Eli Zaretskii wrote:
> > Date: Sat, 4 Nov 2017 16:46:29 +0100
> > From: <tomas@tuxteam.de>

[...]

> > Be gentle :)
> 
> I only ask these questions veteran contributors to Emacs who are quite
> able to distinguish bugs from cockpit errors.

Understood.

> Please be gentle with me as well.

It would be a mistake otherwise. Please call me out when I'm not.

In that case: I'm genuinely sorry.

Cheers
- -- tomás
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEARECAAYFAln96JkACgkQBcgs9XrR2kZjJACfZc2KMwx/r8gsR69ZmVHsnNEx
I3wAn3h60ecGqY5Kzs14QCle+WlzFwwC
=fGq+
-----END PGP SIGNATURE-----



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: tramp and shell, problem on windows 7
  2017-11-04 13:42 ` Michael Albinus
  2017-11-04 14:40   ` Eli Zaretskii
@ 2017-11-05  3:08   ` Shuguang Sun
  1 sibling, 0 replies; 9+ messages in thread
From: Shuguang Sun @ 2017-11-05  3:08 UTC (permalink / raw)
  To: Michael Albinus; +Cc: help-gnu-emacs

It works for command shell, but not for dired-do-shell-command, to set
explicit-shell-file-name to "/bin/sh". It confirms the
explicit-shell-file-name and shell-name are used in tramp dired.

On Sat, Nov 4, 2017 at 9:42 PM, Michael Albinus <michael.albinus@gmx.de>
wrote:

> Shuguang Sun <shuguang@gmail.com> writes:
>
> > Hi all,
>
> Hi,
>
> > 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.
>
> > - 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".
>
> > - 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.
>
> > Best Regards,
> > Shuguang Sun
>
> Best regards, Michael.
>


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2017-11-05  3:08 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.