From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id wDt7JJB01WAUawEAgWs5BA (envelope-from ) for ; Fri, 25 Jun 2021 08:15:44 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id iMwwIJB01WAmGAAA1q6Kng (envelope-from ) for ; Fri, 25 Jun 2021 06:15:44 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id B69D121058 for ; Fri, 25 Jun 2021 08:15:43 +0200 (CEST) Received: from localhost ([::1]:34748 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lwf7t-0005FB-Ia for larch@yhetil.org; Fri, 25 Jun 2021 02:15:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48112) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lwf7H-0005Ez-LZ for emacs-orgmode@gnu.org; Fri, 25 Jun 2021 02:15:03 -0400 Received: from mail-pg1-x533.google.com ([2607:f8b0:4864:20::533]:34593) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lwf7F-0004wN-Tf for emacs-orgmode@gnu.org; Fri, 25 Jun 2021 02:15:03 -0400 Received: by mail-pg1-x533.google.com with SMTP id p9so6738632pgb.1 for ; Thu, 24 Jun 2021 23:15:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=references:user-agent:from:to:subject:date:in-reply-to:message-id :mime-version:content-transfer-encoding; bh=d1afB+Ijozpf2gWQHt3oD3/P2FRGdAnISKXd3rmYjiQ=; b=DznU8scdtpsh1BKJ0nmW4U9Kzv2DZd+SZrJJAlzuGk9tKClMsEYEG1wAO+sPyDUgcr 2OtHGjrrJ+ZfRwunVTSDCxxkiCV/C0MsY4VB9H4J4ahnxlM83tZQLlPE7KlqmS/NQLnQ xshd8Y2Opn9NHK5+BhfzP+8VHKl2lgGJ9xX0MmKAPBmMAbKoXzpBC6yPXFpFVFpx4evQ oTVWjZqS9ztORq+W5xqPNAzYjs5up2+B4XI/Vsa5023by+Bxq2d+2LPBp2bcaAPHhqy7 0lsqWXW4V6pUeLjwyBvDu73yxN6MeOH1pW94UNBqM/owW9vVA3cfqRHocJI094OlwiDX PZSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:references:user-agent:from:to:subject:date :in-reply-to:message-id:mime-version:content-transfer-encoding; bh=d1afB+Ijozpf2gWQHt3oD3/P2FRGdAnISKXd3rmYjiQ=; b=mHNTp375JCnB+G/vilyVKWe9R2Ieug4PUiO+7t9TSdnDpV1LqhD7EWh1Kf3m7uDhjX acBYPgEeY9iJoPDhksSidLvpFkBQDcFUJnbw+KhzosBbOXfroFJwEZlFiS38qxZU2/eu t2SHMgRAp3Ce4+JawQCTLRUolh20FZuN10XvujAU7PnIuVQPShVg66sTR4AmmcBvSf07 DZo2xbc6asDuxNQq5lC+ovND/0/8Udbt0yprMmd/+3i5C4iQm7jLInU+ZpXq+7+ciZ71 3iYSJtu5HENPwyjmRNN7LxcjgWSrDXFNov5oXxZdJxuNKRGKNZAQnn27Kjkn5zb0d5Jz mc6g== X-Gm-Message-State: AOAM532cgBuLI8hDcDQ1BUw5v9Om2DLJia+hzsg1XRg0GRFMoDmBQkvz /g77mrtzFpCGyb/aNmQuV0QFCdHnglI= X-Google-Smtp-Source: ABdhPJyO22ZtYLmZ+pfxoaPBMDx13KdG+tz02mCj3MbKOTQQn6JtqGgkZd0qx7hfMaPjhPNmKInmNQ== X-Received: by 2002:a63:1263:: with SMTP id 35mr7980962pgs.221.1624601700148; Thu, 24 Jun 2021 23:15:00 -0700 (PDT) Received: from tim-desktop (106-69-124-64.dyn.iinet.net.au. [106.69.124.64]) by smtp.gmail.com with ESMTPSA id w20sm5411979pff.90.2021.06.24.23.14.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Jun 2021 23:14:59 -0700 (PDT) References: <3D86861D-E962-4FDB-B520-374C883C9F1E@block-party.net> User-agent: mu4e 1.5.13; emacs 28.0.50 From: Tim Cross To: emacs-orgmode@gnu.org Subject: Re: Specifying shells for remote ob-shell sessions? Date: Fri, 25 Jun 2021 15:45:57 +1000 In-reply-to: <3D86861D-E962-4FDB-B520-374C883C9F1E@block-party.net> Message-ID: <87k0mi31y8.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2607:f8b0:4864:20::533; envelope-from=theophilusx@gmail.com; helo=mail-pg1-x533.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1624601744; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=d1afB+Ijozpf2gWQHt3oD3/P2FRGdAnISKXd3rmYjiQ=; b=YnuZuX7tuaBBCrWm5ESMcvBeKxP3BxZENO2d7+k+zBC5WQMNyBcUo5HACtfxfSe+cf74Rb cNz7svhirnuc5aaFS9MdPANqpSpqP8oy2MN7UMWXHs19kc/w8H2H4SaunkrKfiIJ5XHd97 It4ncMyObr1yAChCuhvblqy8NJNsR+5AJ64RVhittbu4dt4beANmpiNWSnA7QuG1ucJL3V FdMLldnmWEm6iLnWDTXkKtdiBEDvsWcndCuq8NGhQhzdx1kW/9Opl4zTvC1B/I4XAzA6gx hviwDX7oEfDea5WRQa9JNJfLF5zGkHKlIgX+GO5YP+uzKIbkYi0k+miHV7LHrQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1624601744; a=rsa-sha256; cv=none; b=ilB1XWbpOjHdokXq8PyQaBLGF39c3zjuGHrrOhaLuRymFuh7yj/SZM6Iennu2DLJewGSnR GDTQMx3SV7OPygP9H876huZkxEoMAGnarnwzOihbssa1/10zlHBinrwYiFCCWPhRhwpb7z y3Ls2UX29USKcjLQlenNAefMnHAcdKxk97aMDcwQZFqp0A2cKLEbbxIxSilI/GU+Fu8oB0 gkqRmnUQh0OCONRyBV/We1fdD9eU36ARGpfQnxUr5ouzAuFm21Sxx6feMrR2/zLoaImrO/ Jk3QOG+OsWJ/4UAu7BOmy1s6l1pvfKu2Ah9tQqtHDWcJW8prh0/neDRD+5gQVw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=DznU8scd; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Spam-Score: -2.13 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=DznU8scd; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: B69D121058 X-Spam-Score: -2.13 X-Migadu-Scanner: scn0.migadu.com X-TUID: mtVrJ6/yFGcE David Dynerman writes: > Dear Org Mode Friends, > > I=E2=80=99m having some trouble getting the shell I want to run on remote= hosts in > session ob-shell blocks - it seems that no matter what shell I specify, s= ession > blocks will always run /bin/sh. I=E2=80=99m not sure if this is an org or= tramp > configuration issue on my end, or a bug in org. > > I=E2=80=99m pasting a snippet that reproduces the behavior in emacs -Q be= low. Does > anyone have an inkling if this is a bug, or, alternatively, suggestions f= or how > I can run remote ob-shell sessions with the shell of my choice? > > Thank you, > David > > #+BEGIN_SRC emacs-lisp=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 > (require 'ob-shell)=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 > (emacs-version)=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20 > #+END_SRC=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20 > > > #+RESULTS: > : GNU Emacs 27.2 (build 1, x86_64-apple-darwin17.7.0, Carbon Version 158 = AppKit 1561.6)=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20 > : of 2021-05-20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20 > > #+BEGIN_SRC emacs-lisp=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 > (org-version)=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20 > #+END_SRC=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20 > > > #+RESULTS: > : 9.4.4=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20 > > #+BEGIN_SRC zsh :dir /ssh:remote-host:/home/ubuntu=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 > echo $0 > #+END_SRC=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20 > > > #+RESULTS: > : zsh=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20 > > #+BEGIN_SRC zsh :dir /ssh:remote-host:/home/ubuntu :session foobar=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20 > echo $0 > #+END_SRC=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20 > > #+RESULTS: > | | > | $ /bin/sh | This is just some wild guess work, so may be completely wrong .... I don't think it is a bug. The ob-shell library doesn't really know anything about remote - the fact you can execute things remotely is just part of the underlying Emacs tramp support. As far as I know, the shell you get in the remote login is determined by the remote host i.e. in the /etc/passwd file of the remote user account (for login shells) and /bin/sh if ssh is just being called to execute a command. In your case, because your calling echo $0 it is executed with /bin/sh I would start with tramp and try to configure it to execute commands using zsh. The ob-shell library isn't really aware of 'remote' - it is just calling tramp based on the path you provide, which is why I think tramp is a good place to start. If this cannot be easily done, look at the= ssh manual and see if you can do this via a ~/.ssh/rc file on the remote host. If you cannot find a way to configure tramp, perhaps try working out how to just execute commands over ssh in a specific shell, like zsh. I suspect once you work out how to do this with plain ssh, you may see a way to configure tramp to do the same. A final solution would be to just add a call to zsh in your source block before the rest of what you want to run.=20 --=20 Tim Cross