Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Is this possible with zsh?
- X-seq: zsh-users 9505
- From: Peter Stephenson <pws@xxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: Is this possible with zsh?
- Date: Mon, 17 Oct 2005 10:26:50 +0100
- In-reply-to: <20051016.070625.41172876.Meino.Cramer@xxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <20051016.070625.41172876.Meino.Cramer@xxxxxx>
Meino Christian Cramer wrote:
> Is it possible to "shell-program" or configure any neat trick (you
> see, I am missing the right words here...) that "something" will be
> executed, when the last of the non-login-shells, which are running
> under my uid, is sclosed ?
You can get arbitrary code to run when a shell exits with:
my-exit-fn() {
# stuff
}
trap my-exit-fn EXIT
but you still need to work out when the last shell is being closed.
The obvious tricks, other than doing it in the X files rather than the
shell, are to use ps to check processes or to have shells register
and unregister. The first alternative is likely to be more solid.
You could, for example, check if the parent process was a terminal emulator.
pws
This message has been scanned for viruses by BlackSpider MailControl - www.blackspider.com
Messages sorted by:
Reverse Date,
Date,
Thread,
Author