From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18204 invoked by alias); 14 Apr 2017 17:40:32 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 40972 Received: (qmail 10839 invoked from network); 14 Apr 2017 17:40:32 -0000 X-Qmail-Scanner-Diagnostics: from 195.159.176.226 by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(195.159.176.226):SA:0(2.7/5.0):. Processed in 18.089712 secs); 14 Apr 2017 17:40:32 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: ** X-Spam-Status: No, score=2.7 required=5.0 tests=DKIM_ADSP_CUSTOM_MED, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, NML_ADSP_CUSTOM_MED,RDNS_NONE autolearn=no autolearn_force=no version=3.4.1 X-Envelope-From: gcszd-zsh-workers@m.gmane.org X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: none (ns1.primenet.com.au: domain at m.gmane.org does not designate permitted sender hosts) X-Injected-Via-Gmane: http://gmane.org/ To: zsh-workers@zsh.org From: Christian Neukirchen Subject: Re: allow zsh to source a script and then become interactive Date: Fri, 14 Apr 2017 19:24:46 +0200 Message-ID: <87fuha297l.fsf@gmail.com> References: <20170414165548.GA13756__8716.79648194022$1492189045$gmane$org@teapot.bifb.org> Mime-Version: 1.0 Content-Type: text/plain X-Complaints-To: usenet@blaine.gmane.org User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) In-Reply-To: <20170414165548.GA13756__8716.79648194022$1492189045$gmane$org@teapot.bifb.org> (Anthony Fletcher's message of "Fri, 14 Apr 2017 12:55:48 -0400") Anthony Fletcher writes: > This is an oldie but goodie that I don't have a solution to. How can I > invoke a zsh that sources a particular file (not the standard start up > files) and then become interactive, preserving functions, etc? > > This is akin to the ksh invocation: > > ENV=startup ksh > > or bash's > > bash --rcfile startup > > One solution was covered in 2005 by Bart: see > http://www.zsh.org/mla/users/2005/msg00600.html However this only works > if you can change the .zshrc file. > > Another alternative is to create a custom .zshrc in a temporary > directory and set the environment variable ZDOTDIR. But this is a little > clunky. > > I look after an increasing disparate collection of systems and I'd > like to launch a customised zsh on a remote system without changing > anything ahead of time. An interesting alternative could be to start an interactive zsh from anywhere, e.g. rc(1) has `. -i /dev/tty`... I'm not sure how many changes this would require to zsh architecture. -- Christian Neukirchen http://chneukirchen.org