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

Re: HOW TO distiguish between command input and forked subshell ?



On Sep 6, 12:47am, C. v. Stuckrad wrote:
> Subject: HOW TO distiguish between command input and forked subshell ?
> 
> Hi! (again :-)

You should be asking these questions on zsh-users rather than zsh-workers.
They don't have much to do with zsh development or build problems.

Not that it would matter much, since everybody on zsh-workers also gets
zsh-users, but some people might be filtering based on the To: address.

> 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
}



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