zsh-workers
 help / color / mirror / code / Atom feed
From: "Kalmár Gergely" <kgregory89@gmail.com>
To: Roman Perepelitsa <roman.perepelitsa@gmail.com>
Cc: Bart Schaefer <schaefer@brasslantern.com>, zsh-workers@zsh.org
Subject: Re: --init-file option
Date: Mon, 13 Feb 2023 21:59:44 +0100	[thread overview]
Message-ID: <CAKue2cRDk0j_4jPmQd6rQxb3utc5N=BvS0jDSrOXVASLbDcyqQ@mail.gmail.com> (raw)
In-Reply-To: <CAN=4vMpTEL7cQJppNzxO8GPUagS=nu-SN4aYH=ZULEMUtSV8aA@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1446 bytes --]

Yes, I could do something similar as what zshi does, but that seems like a
suboptimal solution, because it would require a duplication (and indefinite
maintenance) of the startup file processing logic in an independent
codebase. As the logic is not trivial and has some potential pitfalls as
well, it seems to me that implementing the option within Zsh would be the
most sound (and perhaps simplest) solution from an engineering and
long-term maintenance perspective.

On Mon, Feb 13, 2023 at 9:34 PM Roman Perepelitsa <
roman.perepelitsa@gmail.com> wrote:

> On Mon, Feb 13, 2023 at 9:29 PM Bart Schaefer <schaefer@brasslantern.com>
> wrote:
> >
> > Create a directory "virtualenv" with the appropriate configuration in
> > virtualenv/{.zshenv,.zshrc,.zprofile,.zlogin} and use
> >   env ZDOTDIR=virtualenv zsh ...
> >
> > most likely you want virtualenv/.zshrc to be "source $HOME/.zshrc ;
> > source xxx" and everything else to merely source the corresponding
> > $HOME file.
> >
> > Adjust for absolute paths as needed.  A bit of extra work required if
> > you want to preserve an existing $ZDOTDIR before replacing it.
>
> zshi essentially automates this process. It also takes some care of
> restoring `ZDOTDIR` before sourcing the real user rc files and
> checking `[[ -o rcs ]]` afterwards. There is still one thing that
> breaks when using zshi (or doing the same thing manually): global rc
> files see the wrong `ZDOTDIR`.
>
> Roman.
>

[-- Attachment #2: Type: text/html, Size: 1915 bytes --]

  reply	other threads:[~2023-02-13 21:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-13 10:57 Kalmár Gergely
2023-02-13 11:24 ` Roman Perepelitsa
2023-02-13 13:43   ` Kalmár Gergely
2023-02-13 20:28     ` Bart Schaefer
2023-02-13 20:34       ` Roman Perepelitsa
2023-02-13 20:59         ` Kalmár Gergely [this message]
2023-02-13 21:46           ` Bart Schaefer
2023-02-14 10:18             ` Kalmár Gergely

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAKue2cRDk0j_4jPmQd6rQxb3utc5N=BvS0jDSrOXVASLbDcyqQ@mail.gmail.com' \
    --to=kgregory89@gmail.com \
    --cc=roman.perepelitsa@gmail.com \
    --cc=schaefer@brasslantern.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).