From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8233 invoked from network); 6 Oct 1999 18:09:42 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 6 Oct 1999 18:09:42 -0000 Received: (qmail 25318 invoked by alias); 6 Oct 1999 18:09:24 -0000 Mailing-List: contact zsh-users-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 2661 Received: (qmail 25310 invoked from network); 6 Oct 1999 18:09:23 -0000 From: "Bart Schaefer" Message-Id: <991006180909.ZM10734@candle.brasslantern.com> Date: Wed, 6 Oct 1999 18:09:09 +0000 In-Reply-To: =?iso-8859-1?Q?=3C37FB1C0E=2E4E5E623D=40camline=2Ecom=3E?= =?iso-8859-1?Q?Comments=3A_In_reply_to__Johannes_M=E4hner_=3Cjohanm=40cam?= =?iso-8859-1?Q?line=2Ecom=3E?= =?iso-8859-1?Q?________=22dirstack-inheritance=22_=28Oct__6=2C_11=3A53am?= =?iso-8859-1?Q?=29?= References: <37FB1C0E.4E5E623D@camline.com> X-Mailer: Z-Mail (5.0.0 30July97) To: =?iso-8859-1?Q?Johannes_M=E4hner?= , ZSH User Subject: Re: dirstack-inheritance MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable On Oct 6, 11:53am, Johannes M=E4hner wrote: } Subject: dirstack-inheritance } } Is there a way to inherit the directory stack in other zsh-sessions? } (analogous mechanism as of command-history (incappendhistory, } sharehistory) wanted) You aren't actually suggesting that all the shells change current directo= ry in sync, are you? I'm also uncertain what you think should happen in one= shell when another shell cycles its directory stack or swaps the top entr= y with $PWD or the like. The directory stack can change in a whole lot of ways that history can't. If one shell pops a directory out of the stack,= does it disappear from all the shells' stacks? If not, and like history you only share additions, when does the stack ever shrink? (Arbitrarily discard entries from the end when it exceeds a certain size?) If you have 3.1.6-pws-6, you might be able to work something out using `zmodload parameter' and then mucking with $dirstack. If all you care about is having a new shell start up with the same directory stack as the= most-recently-used shell, you can do put in .zshrc something like: zmodload parameter && { [[ -f ~/.zdirs ]] && dirstack=3D( $(< ~/.zdirs) ) && popd precmd() { dirs >! ~/.zdirs } } (The "popd" is because "dirs" is equivalent to "echo $PWD $dirstack".) If you don't have 3.1.6-pws-6, you can do dirstack=3D( $(< ~/.zdirs) ) cd $dirstack[-1] dirstack[-1,-1]=3D() while (($#dirstack)); do pushd $dirstack[-1] dirstack[-1,-1]=3D() done -- = Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com