From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4976 invoked from network); 27 Mar 2008 12:36:01 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.4 (2008-01-01) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=ham version=3.2.4 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 27 Mar 2008 12:36:01 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 84232 invoked from network); 27 Mar 2008 12:35:58 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 27 Mar 2008 12:35:58 -0000 Received: (qmail 17987 invoked by alias); 27 Mar 2008 12:35:56 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 24763 Received: (qmail 17969 invoked from network); 27 Mar 2008 12:35:55 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 27 Mar 2008 12:35:55 -0000 Received: from wr-out-0506.google.com (wr-out-0506.google.com [64.233.184.229]) by bifrost.dotsrc.org (Postfix) with ESMTP id A6A9F82CD267 for ; Thu, 27 Mar 2008 13:35:47 +0100 (CET) Received: by wr-out-0506.google.com with SMTP id c46so4737262wra.18 for ; Thu, 27 Mar 2008 05:35:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=kR/QihyAEaNhPtl07g6D5OUoUsM6E9AwL09RSEwF24Y=; b=Ht+5jo7JZ86jPo0Uw+Qk9Jiio27355TITE89Bfwebri6gueAnzzc0DknSFKrurBTJfx0UMJexeE2BUZmk6elR390bl2FdNvYdcfkPH708M/DJu0BepJPmBViVFfc/V0LwtZlO8iIIJjRsftExDNiQJtcmRgzI/fgtEmWQnd9umc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=ovRCNIEzPVV9dIq3Z5Fa2M41sSopkrrc/AcHS6QQvbD9wP+Q8OxE4MGU1OKh8jmcGCKLar/1MlJPMtONLewZfy9UGn0q+hz/Q+LvAzaO553d41BEXRWQ1PaliZQvkPh+cfiOtPk+Gx51jBxI0lKKCx++bMDCrroT4lGpcuKkyT4= Received: by 10.114.120.1 with SMTP id s1mr1303592wac.82.1206621346395; Thu, 27 Mar 2008 05:35:46 -0700 (PDT) Received: by 10.114.153.20 with HTTP; Thu, 27 Mar 2008 05:35:46 -0700 (PDT) Message-ID: <237967ef0803270535w2267fc7fi525b68efb29c43a@mail.gmail.com> Date: Thu, 27 Mar 2008 13:35:46 +0100 From: "Mikael Magnusson" To: "Peter Stephenson" Subject: Re: PATCH: cd -q (was Re: _canonical_path ...) Cc: zsh-workers@sunsite.dk In-Reply-To: <20080327121525.5b4059f9@news01> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20080326114413.80713vrmznwpnyuc@bapt.selfip.org> <200803261540.m2QFeJmm017381@news01.csr.com> <200803261604.m2QG41Ke017772@news01.csr.com> <200803261621.m2QGLptV017966@news01.csr.com> <20080326173824.0a55c00d@coredump.raveland.priv> <20080326164615.1d5893ed@news01> <20080327102325.55808716@news01> <20080327120807.415095ee@raveland.org> <20080327112506.7298e9ef@news01> <20080327121525.5b4059f9@news01> X-Virus-Scanned: ClamAV 0.91.2/6421/Thu Mar 27 09:54:20 2008 on bifrost X-Virus-Status: Clean On 27/03/2008, Peter Stephenson wrote: > The more I think about this (and I'd really like to stop now), the more > wrong it seems to me that it's so hard to get the shell to cd without > side effects. Indeed, the patch above is incomplete since it omits > the new chpwd_functions array, and I haven't work out a foolproof > way of suppressing the effect of chpwd without forking the shell. > chpwd will typically print a bogus directory to the terminal title > bar, which is to be avoided; but it can in principle do anything > and if we're not sticking around in the directory the interactive > environment really doesn't need to care about the cd. > > Any comments about the following proposal, which adds the -q option > to all relevant functions? If it looks OK, I'll change the function > above to unsetopt PUSHD_NO_DUPS and use pushd -q/popd -q to sanitize > the directory with REPLY=$PWD and remove the fork. Nice, I've wanted this on several occasions. Especially since sometimes my chpwd function breaks constructs like (cd /foo; tar c .) | tar x. I worked around that by printing everything to stderr instead but it seems icky. Also, I realized I didn't know what the existing options -sLP did, so I looked at the manpage and 1) there's a typo near the beginning Otherwise, if var(arg) begins with a slash, attempt to change to the director given by var(arg). 2) If the -P option is given or the CHASE_LINKS option is set, symbolic links are resolved to their true values. If the -L option is given symbolic links are followed regardless of the state of the CHASE_LINKS option. Intuitively this paragraph doesn't make any sense. Both options seem to do the same thing? (-P || CHASE_LINKS) || -L == -P || -L || CHASE_LINKS -- Mikael Magnusson