[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] How to use org mode shell with ssh?

From: Fabrice Popineau
Subject: Re: [O] How to use org mode shell with ssh?
Date: Thu, 22 Sep 2016 22:30:12 +0200

My $0.02

As I'm using Emacs on Windows, with MSYS2+MingW64, I tried this.
There is a problem with using bash from a _native_ MingW64 Emacs:
bash is a MSYS2 app and Emacs is a MingW64 app.

From emacs, I would have used the plink protocol, so that's what I did.
And I got this message in the *Org-Babel Error Output* buffer

/bin/sh: 1: C:/Local/Emacs/bin/cmdproxy.exe: not found

So I looked at ob-eval.el and the org-babel-eval function. 
And there are at least 2 big problems.
1- when entering this function, the `command' parameter is "C:/Local/Emacs/bin/cmdproxy.exe"
2 - the `shell-file-name' variable has the same value
So the following won't work for Windows :
        ;; Unfortunately, `executable-find' does not support file name
;; handlers.  Therefore, we could use it in the local case
;; only.
(cond ((and (not (file-remote-p default-directory))
    (executable-find shell-file-name))
(concat (file-remote-p default-directory) shell-file-name))

BTW I don't see the point concatenating shell-file-name with default-directory when the later is remote.
Do we expect to find the shell in the remote directory ?

Anyway, there is little chance this stuff will work under Windows with a native Emacs.
If I find time, I may try to propose some fix.


2016-09-22 16:52 GMT+02:00 Nick Dokos <address@hidden>:
Colin Baxter <address@hidden> writes:

>> #+BEGIN_SRC shell :dir /scp:openwrt:/mnt/sda1
>> ls -al
>> #+END_SRC
>> The error, I think, is from the remote end.
>> /bin/sh: /bin/zsh: not found
>> Clearly, I am using zsh on my Windows, but my remote OpenWRT system only has ash installed. Is
>> there's way to specify the shell to use on the remote end?
> I can't help you here. I've never used openwrt. All I can suggest is to
> search openwrt documentation or try with cgywin.

IIUC, openwrt is the name of the remote node - nothing to do with OpenWrt (except of course, that
the remote node may be a router which has been flashed with OpenWrt, but that should make no
difference to ssh/tramp).


Fabrice Popineau
Département Informatique
3, rue Joliot Curie
91192 Gif/Yvette Cedex
Tel direct : +33 (0) 169851950
Standard : +33 (0) 169851212

reply via email to

[Prev in Thread] Current Thread [Next in Thread]