Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

((Re: set -vx changes output of)) subshells

On Wed, 5 Feb 1997, Daniel Dignam wrote:
>    My assumption was that the set -vx didn't get inherited by the
> subshells, but my understanding would appear to be false, I guess $()
> isn't really a subshell ...

Well, This reminds me of a question I never could get solved so far:

How, if it is at all possible, can a $(...) subshell or the inside of a
construct 'know' that is not '*THE* interactive' shell ?

Simple but irritating (for me) exammple:

Assume you make a function 'xswt' which sets Window titles in X11-Xterms.
Then you include 'xswt' inside of chpwd, so it gets executed at every 'cd'
and so the title can show the current directory. -- ok so far.

NOW you use something like:

- to make a crude comparison of two directories:
	ls $(cd somwhere; ls)
- to make something in a tree:
	for i in $(locate subdirs)
		( cd $i; make )

In both cases you end up with the wrong title and
in the second case with 'blinking' the title through all dirs.

As there is no 'falling back'-function after the sub-shell does 'cd'
there is no chance to set the title BACK, but
	??? Is there a chance to AUTOMATICALLY NOT set the title ???
	(which means 'automatically not to execute chpwd' or somehow
         tell a shell it is a subshell or a construct or function)

I know that this look like the request for a mindreader 'do_what_I_think'
function, but may be I overlook something simple ...


Christoph von Stuckrad       * *  | talk to  | <stucki@xxxxxxxxxxxxxxxxx> \
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        /

Messages sorted by: Reverse Date, Date, Thread, Author