From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id yO9HI+XhUGCjSQAA0tVLHw (envelope-from ) for ; Tue, 16 Mar 2021 16:50:45 +0000 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id cBkWH+XhUGC3BwAAbx9fmQ (envelope-from ) for ; Tue, 16 Mar 2021 16:50:45 +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 1BBC42DB30 for ; Tue, 16 Mar 2021 17:50:44 +0100 (CET) Received: from localhost ([::1]:55820 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lMCu2-0002sn-RV for larch@yhetil.org; Tue, 16 Mar 2021 12:50:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48760) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lMCsn-0002gR-6M for emacs-orgmode@gnu.org; Tue, 16 Mar 2021 12:49:26 -0400 Received: from ciao.gmane.io ([116.202.254.214]:48698) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lMCsj-0006bS-Ta for emacs-orgmode@gnu.org; Tue, 16 Mar 2021 12:49:24 -0400 Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1lMCsi-0008xJ-2I for emacs-orgmode@gnu.org; Tue, 16 Mar 2021 17:49:20 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: emacs-orgmode@gnu.org From: Nick Dokos Subject: Re: How to get shell source blocks to read my profile? Date: Tue, 16 Mar 2021 12:49:14 -0400 Message-ID: <87zgz36o39.fsf@alphaville.usersys.redhat.com> References: <87a6r5l5bh.fsf@gmail.com> <87ft0x2hbe.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cancel-Lock: sha1:lN29cMdb0EJ2utZkEHDN5s4gA3k= Received-SPF: pass client-ip=116.202.254.214; envelope-from=geo-emacs-orgmode@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIM_ADSP_CUSTOM_MED=0.001, FORGED_GMAIL_RCVD=1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, NML_ADSP_CUSTOM_MED=0.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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=1615913445; 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: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post; bh=MqyBY9c844cZlPMyiVfLr9e+hWtCX4bFg9VWndguHQM=; b=CzdNjx/UVvCuOX14vv0aiNWWo0JM93nJn6PtzxTDySWQ1oMUIrJ080zuP4Vw24eUXbcpMY dPTx9EegDy37ZkBY5H+77pqI/P4nEqRxiKkHmnLHQMIKo1FV50d3K1zTbyJTRtwAmrWb9U kpXsHCoJvpQbeLgwyFVpnu6e746L8fsZ8IDoveamuBJagjZp/fwzuDuGT0zkJtkQFMR7D8 iF47sfCb2luxNVqHqhXHd2PRlCvU/xE8XTgAy7e8u1ne0Ljqbm81U3CqlTdBkKktx2tLIR hWx7MMymf3uQ9e0IvOxxfQvn/ExN6BSLnJUeUcdVyxovPHJf1oxtWWfxjkPg9g== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1615913445; a=rsa-sha256; cv=none; b=Ob+PUrq8OvvZbKWrUhtE2MHHaQC+mfeUbPldUzOlz8UfnFZAntYjpVyEqibEVPZS7C9cyh FMMX73Pug8X6IcH6BX3ZiCeDD00359TfodLX84D1KpU3svhxlUVsc0zwTHELa635fzboc9 YQhnqs5SaQHfTj8Lz8d41ZL6Tm7bJZOaT0WFc7Gy82pMXLSDWYbLYr0sppDLQr4310+P6d 3H6W4p3yjv283AdPhrSBZ/lUmWEAcumaShJumrUid5cATJJJ2Fy7ZJ82ayl+TDmsp7SkcM 19bUgiuQvinOPkPvp7tr7AotKsf88T7gZBmxqWIs9YpRh/mDi0s/oTMT03P2Cw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=gmail.com (policy=none); 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: 0.70 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=gmail.com (policy=none); 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: 1BBC42DB30 X-Spam-Score: 0.70 X-Migadu-Scanner: scn0.migadu.com X-TUID: z1VbAFgkmZWO George Mauer writes: > I understand why you say that maxim but testing that this worked was the first thing I did > and it does work. I was surprised as well. I haven't debugged all the way into the eval > functions to see why this works but my guess is that the authors were pretty smart about > figuring out which executable to invoke. > Starting with `emacs -q' I evaluate (setq shell-file-name "bash -i") in the *scratch* buffer and then do `M-x shell'. I get apply: Searching for program: No such file or directory, bash -i If I do (setq shell-file-name "/bin/bash -i") I get emacs: /bin/bash -i: No such file or directory Process shell exited abnormally with code 127 The trouble is that `shell-file-name' may be used much more widely than you expect. > As for the problem I'm trying to solve, there isn't one exactly. This is more me hacking on > something I don't fully understand because it regularly trips me up. > > I do still wonder what would be the disadvantage of just configuring it to do --login by > default and doing all configuration in profile scripts. It would be unconventional yes, but > it would also make dynamic scoping of environment variable effectively opt-in via > --noprofile rather than opt-out (which imo is how it should be). I would assume that uses > extra resources or risks improperly handling crashed processes, but I can't find anything to > that effect in the docs > > On Tue, Mar 16, 2021, 07:32 Maxim Nikulin wrote: > > On 16/03/2021 00:49, George Mauer wrote: > >    shell-file-name: "/bin/zsh -i" > > I am afraid, you should be prepared to face some problem accidentally. > The value of this variable is used to execute the specified file > ("zsh -i" in the "/bin" directory, I do not think, you have such file), > not as a part of shell command. shell-file-name in namely file name to > be executed with shell-command-switch as first argument (separate > arguments, not merged into a string) to run shell commands (next argument). > > Environment variables could be set on OS level, inside emacs > https://www.gnu.org/software/emacs/manual/html_node/emacs/Environment.html > , etc. It is hard to suggest something since you have not described the > problem you are trying to solve. Tim in details explained why you > attempt to solve it did not work, but the problem (or the goal) is still > unknown. > -- Nick "There are only two hard problems in computer science: cache invalidation, naming things, and off-by-one errors." -Martin Fowler