From: "C. v. Stuckrad" <stucki@math.fu-berlin.de>
To: zsh-users@math.gatech.edu
Subject: HOW TO distiguish between command input and forked subshell ?
Date: Sat, 7 Sep 1996 18:30:06 +0200 (MET DST) [thread overview]
Message-ID: <Pine.GSO.3.95.960907181553.14562A-100000@petzval> (raw)
In-Reply-To: <960905162314.ZM11373@admin.diego.netmanage.com>
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 | <stucki@math.fu-berlin.de> \
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 /
next parent reply other threads:[~1996-09-07 16:36 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <960905162314.ZM11373@admin.diego.netmanage.com>
1996-09-07 16:30 ` C. v. Stuckrad [this message]
1996-09-16 7:07 ` Bart Schaefer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Pine.GSO.3.95.960907181553.14562A-100000@petzval \
--to=stucki@math.fu-berlin.de \
--cc=zsh-users@math.gatech.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).