From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from euclid.skiles.gatech.edu (list@euclid.skiles.gatech.edu [130.207.146.50]) by coral.primenet.com.au (8.7.5/8.7.3) with ESMTP id TAA01367 for ; Fri, 6 Sep 1996 19:15:18 +1000 (EST) Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id FAA05438; Fri, 6 Sep 1996 05:10:59 -0400 (EDT) Resent-Date: Fri, 6 Sep 1996 05:10:59 -0400 (EDT) Date: Fri, 6 Sep 1996 13:08:49 +0400 (MOW) From: Andrej Borsenkow X-Sender: bor@itsrm1.mow.sni.de Reply-To: borsenkow.msk@sni.de To: Zsh workers list cc: Bart Schaefer Subject: Re: HOW TO distiguish between command input and forked subshell ? In-Reply-To: <960905162314.ZM11373@admin.diego.netmanage.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Resent-Message-ID: <"4qXEQ.0.uK1.Yg-Bo"@euclid> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/2110 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu On Thu, 5 Sep 1996, Bart Schaefer wrote: > > > Exactly, I want to have the function 'chpwd' give some output > > if triggered by 'cd' or 'chdir' BUT TO GIVE NO OUTPUT > > if triggered by cases like '... $(cd somewhere; ls)...' > > > > Might that be possible ? > > chpwd() { > if [[ -t 1 ]] > then > print By golly, my standard output is a terminal. > fi > } > There is a little problem with output of chdir(). Here follows: if I cd to non-local directory using CDPATH, cd will report current directory after changing to it. I always found it boring (as I have directory in prompt anyway) and suggested the option to shut it off. The answer was (as expected ;) that I can use cd () { builtin cd $* > /dev/null } Well, it works, but any output from chdir() is also lost :( I don't know, if it is right, that chdir() is using the same descriptor as cd, but if it is to be so, may be new option is still useful? greetings ------------------------------------------------------------------------- Andrej Borsenkow Fax: +7 (095) 252 01 05 SNI ITS Moscow Tel: +7 (095) 252 13 88 NERV: borsenkow.msk E-Mail: borsenkow.msk@sni.de -------------------------------------------------------------------------