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 CAA00198 for ; Sun, 8 Sep 1996 02:36:25 +1000 (EST) Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id MAA26335; Sat, 7 Sep 1996 12:33:20 -0400 (EDT) Resent-Date: Sat, 7 Sep 1996 12:31:49 -0400 (EDT) Date: Sat, 7 Sep 1996 18:30:06 +0200 (MET DST) From: "C. v. Stuckrad" X-Sender: stucki@petzval Reply-To: "C. v. Stuckrad" To: zsh-users@math.gatech.edu Subject: HOW TO distiguish between command input and forked subshell ? In-Reply-To: <960905162314.ZM11373@admin.diego.netmanage.com> Message-ID: X-TestHeaderA: Written by C. v. Stuckrad; FB. Mathematik; EDV X-TestHeaderB: FU-Berlin; Arnimallee 2-6; 14195 Berlin; GERMANY Priority: normal MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Resent-Message-ID: <"oA0zB2.0.rQ6.rDQCo"@euclid> Resent-From: zsh-users@math.gatech.edu X-Mailing-List: archive/latest/396 X-Loop: zsh-users@math.gatech.edu X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu On Thu, 5 Sep 1996, Bart Schaefer ANSWERED: > Subject: Re: HOW TO distiguish between command input and forked subshell ? > On Sep 6, 12:47am, C. v. Stuckrad ASKED: > > Subject: HOW TO distiguish between command input and forked subshell ? > > 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)...' *** this was exactly enough specified *** > chpwd() { > if [[ -t 1 ]] > then > print By golly, my standard output is a terminal. > fi > } OK, thanks for explaining (again), and this works perfectly well in this case of ... $(cd ...)... ! The User who aked was a typical beginner, who used a macro/function chpwd () { ...to change x-window-title to the current dir... } and now the title is no longer changed by cd-ing inside of $() expansions. BUT if you just type '(cd somwhere; do_something)' you again get the title changed to 'somewhere' instead of staying where the zsh stood and stayed ! Does somebody see a chance to distinguish the two cases ? I first thought $SHLVL, but it stays the same! Does ...; ( something ) ; ... the same as ... { something } ; ... ??? Again clueless (this time on zsh-users :-) Stucki Christoph von Stuckrad * * | talk to | \ Freie Universitaet Berlin |/_* | nickname | ...!unido!fub!leibniz!stucki| Fachbereich Mathematik, EDV |\ * | 'stucki' | Tel:+49 30 838-7545{9|8} | Arnimallee 2-6/14195 Berlin * * | on IRC | Fax:+49 30 838-5913 /