From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,HTML_MESSAGE,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 4884 invoked from network); 14 Feb 2023 10:19:37 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 14 Feb 2023 10:19:37 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1676369977; b=btv97MHP+GaASqiJLt55TXInssTNjr8gcYsX2Gk32tItXqMH76XNOHz7XVEo1QWyR9Agj1fiUB laUaDsd++97vNzNKc/wCyBEYeK7zDr6y1fRRlYVgICEruo2WdHreLqxQnzMH5wK1oobu7/SieY 1SdZwtYMp0T5/yba78ZI9gx2YP3pvi+NGURl2PPq8MGfiL4/gxGzdZRessZ66PFM469xytPROV 4IE6PX1C6rRKJxoqKDAgP0skZ2WZuqIN/EhQVUB4FUqf12Ln0kV9ruxvyr/GN/CraCn3XYGSZk lZmU0j0ueNN7rfkLMR2p0TiedUg+70BkbidwFv0sMqCioQ==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-qt1-f177.google.com) smtp.remote-ip=209.85.160.177; dkim=pass header.d=gmail.com header.s=20210112 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1676369977; bh=FgHS7XdvHZGCouxw8xJXyn+LWq8nHfAAbDptQo7mpeQ=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:DKIM-Signature:DKIM-Signature; b=pMdirZNKaGiUPrWOWSzLWMcj5NpURUi4M3xVTVaDi8PsJ4LuQEFdIZ/VQnM4BzJfnj0eXowcq/ 3luhv0fRdbWPx3RH4Py/DQSs360Rbkw8aI6fA1HRN+4SMKv+24X4bh7HjOCCY88trnm+am2F+F BoxXeOba2+fllIYRtnEjTmb4tYEgqDjqTpCeDICP4lEBno6ONV1Oeu9HwqaUusmu2MTICgUtZF swAiTxSHWdWW+X71F/9sbeyqbWLgDZVoLlvXtwYrxy4tUbNIGXJobxCECyRuKIXNJA26X4HgSx Jr8FhFtAIIPAiSYuKWqIz5dH+WL1RQSUejN6CB7Q1n4mYw==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID :Date:From:In-Reply-To:References:MIME-Version:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=tS6pBs/R4oTlJqUJmonaQQPat+JqvoiWBFTkEN9swD8=; b=RQ55pkqdgEPpLcowrz9Q/3JyHM 36g5Y0l88bzuTf/RcxNIwlcQBjzy4aC4Ooiu1Ev/6P6mLuge8Xl6GLnIFSjIy2XmwaGHf26hE15Hj iwGX3GrDbwEepFSyQ9gQmR1BR6FoIPmf+rA+ZvVm67b0fJ+nTnxykIufDImheHtKpbfCi5pGtE4KI 8+0XWNcdGGPvxU4TmcDCH4Rnuz3ywf/1XKxyjyW3MxMIY+lG1tkoCXwLzuVUWBMuNHvxqkneO+KlG 1MfV6rtD7C6FN6EvncymFFZSO1Vkyhjuuw2CRpFhH7rakHRLSd5VaE3iTSdNU1Hzlt06qOTJzJhkJ HvtPOElg==; Received: by zero.zsh.org with local id 1pRsPP-0000wS-7X; Tue, 14 Feb 2023 10:19:35 +0000 Authentication-Results: zsh.org; iprev=pass (mail-qt1-f177.google.com) smtp.remote-ip=209.85.160.177; dkim=pass header.d=gmail.com header.s=20210112 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-qt1-f177.google.com ([209.85.160.177]:43989) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1pRsOo-0000bF-L0; Tue, 14 Feb 2023 10:18:59 +0000 Received: by mail-qt1-f177.google.com with SMTP id cr22so16848504qtb.10 for ; Tue, 14 Feb 2023 02:18:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=tS6pBs/R4oTlJqUJmonaQQPat+JqvoiWBFTkEN9swD8=; b=Im0U7GG5fs6GVv7NALtTljKoj1OMjJ+dN4rRLze3M87UjbW97oab/c05UhZ2cSlmc3 1V5YbAAtUnGl6tQz5o2af4QrrkUWPe2o78mmn8P3IoaZQr18dv5mLTjsZgyDfcY8rZU2 Q9vApRc2z1WTvRswhAvjmj4XWVCHUDGzAhgVmq9ryVR8mDRPI6Y8G8p7waKv0B/7VyTu NCYo8P38RyVKBdbIo2F6SjAqM7dRpdolzdv7sVnVdkkJ9eiTXc75iOkPxAiPPbZWag78 FoUJA1DMWJqMaDMZmybgHlVA+7s0Sio8L6Po4tyT1YIaHxascGdODAieROLOBftev7VV DN0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=tS6pBs/R4oTlJqUJmonaQQPat+JqvoiWBFTkEN9swD8=; b=yEfMDjQp0y9UidiVwrcnyRRj8FtChCyhiYZEXEHCYUDnPCzOHz0ne1HNjhtbVoVybk ZBaPQe1wPeHjXKslvQwbycS/qnuY8hTFKS45UOx+kG1kMfsWbmeLFES0S60dsAmF4u15 XIXweEvXgc7ZB15ITI74byHXGfemSjH4CJ0JVHud6MLwdGgVfAmh1X/4JkdF3Bllo4Ht vK+YSLdtnlJi6VC8ejbJEmGImyr5qxb57AK54Qv6HdtlTL+kfieN3ncp0d2iMCOwenbe 8oENJ77U0A+R34daI3miw2hc9mdXl/t0245M/LwsXd0cYS5U/2/KkZ88pLAXSbJiXr0+ C1nQ== X-Gm-Message-State: AO0yUKXftWwaqasHuwy1H6A4fSFueHKCdimXLgOLvEp2D1OCq7+g8En8 Q5tdQcS4JD1HEaU0tFrn9Fp0jpPRMlN+2x30iMo= X-Google-Smtp-Source: AK7set95qmrIWXa2IS9kEM8mwh5vFtwBJ1OCpzoxo5wOptvPHFPurg7xlTViXsdbRsakWk6v7ERrJaz+bPWSaIm1p+4= X-Received: by 2002:ac8:7d8d:0:b0:3b8:6b74:8ac2 with SMTP id c13-20020ac87d8d000000b003b86b748ac2mr173285qtd.162.1676369937672; Tue, 14 Feb 2023 02:18:57 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: =?UTF-8?Q?Kalm=C3=A1r_Gergely?= Date: Tue, 14 Feb 2023 11:18:46 +0100 Message-ID: Subject: Re: --init-file option To: Bart Schaefer Cc: Roman Perepelitsa , zsh-workers@zsh.org Content-Type: multipart/alternative; boundary="000000000000a5ae1405f4a64a3f" X-Seq: 51432 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: , List-Subscribe: , List-Unsubscribe: , List-Post: List-Owner: List-Archive: --000000000000a5ae1405f4a64a3f Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable I meant keeping it in a codebase independent of Zsh's. You are right, bash's --init-file does replace bashrc, so I have to source that too in my activation script. For my use case I just want to start a new shell that works the same to the user as when they start a vanilla shell, with the exception that the virtual environment activation file is sourced. The activation file sets/modifies a bunch of environment variables (e.g. PATH, PYTHONHOME and PS1) and changes the working directory. To me fish shell's --init-command is the most elegant approach, but I can also live with the same approach as what bash does =E2=80=93 in which case I onl= y would need to source .zshrc in my activation script and not meddle with ZDOTDIR (which might have unintended side-effects, like what Roman mentioned regarding the startup files seeing the modified ZDOTDIR instead of what the user potentially sets it to be). On Mon, Feb 13, 2023 at 10:46 PM Bart Schaefer wrote: > On Mon, Feb 13, 2023 at 12:59 PM Kalm=C3=A1r Gergely > wrote: > > > > Yes, I could do something similar as what zshi does, but that seems lik= e > a suboptimal solution, because it would require a duplication (and > indefinite maintenance) of the startup file processing logic in an > independent codebase. > > I don't follow that at all. You're keeping the file for --init-file > somewhere now (I presume), so why would pointing ZDOTDIR at it require > a new codebase? > > Anyway "bash --init-file" replaces (both global and user) bashrc > rather than run the file after them, which doesn't match what you > originally asked for. Does it in fact do what you want? > > Does your file need to create internal variables or functions, or is > it just populating the environment? > --000000000000a5ae1405f4a64a3f Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I meant keeping it in a codebase independent of Zsh's.=

You are right, bash's --init-file does replace bash= rc, so I have to source that too in my activation script. For my use case I= just want to start a new shell that works the same to the user as when the= y start a vanilla shell, with the exception that the virtual environment ac= tivation file is sourced. The activation file sets/modifies a bunch of envi= ronment variables (e.g. PATH, PYTHONHOME and PS1) and changes the working d= irectory. To me fish shell's --init-command is the most elegant approac= h, but I can also live with the same approach as what bash does =E2=80=93 i= n which case I only would need to source .zshrc in my activation script and= not meddle with ZDOTDIR (which might have unintended side-effects, like wh= at Roman mentioned regarding the startup files seeing the modified ZDOTDIR = instead of what the user potentially sets it to be).

On Mon, Feb 13, 2= 023 at 10:46 PM Bart Schaefer <schaefer@brasslantern.com> wrote:
On Mon, Feb 13, 2023 at 12:59 PM Kalm=C3=A1r G= ergely <kgrego= ry89@gmail.com> wrote:
>
> Yes, I could do something similar as what zshi does, but that seems li= ke a suboptimal solution, because it would require a duplication (and indef= inite maintenance) of the startup file processing logic in an independent c= odebase.

I don't follow that at all.=C2=A0 You're keeping the file for --ini= t-file
somewhere now (I presume), so why would pointing ZDOTDIR at it require
a new codebase?

Anyway "bash --init-file" replaces (both global and user) bashrc<= br> rather than run the file after them, which doesn't match what you
originally asked for.=C2=A0 Does it=C2=A0 in fact do what you want?

Does your file need to create internal variables or functions, or is
it just populating the environment?
--000000000000a5ae1405f4a64a3f--