Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: command-not-found handler
- X-seq: zsh-workers 23672
- From: Phil Pennock <zsh-workers+phil.pennock@xxxxxxxxxxxx>
- To: Zsh Hackers' List <zsh-workers@xxxxxxxxxx>
- Subject: Re: command-not-found handler
- Date: Wed, 11 Jul 2007 10:44:16 -0700
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=first1; d=spodhuis.org; h=Received:Date:From:To:Subject:Message-ID:Mail-Followup-To:References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To; b=Vm3jvf3eiJpCxDSirOKTCnSXkxZeomaM7xF8P6ldRYDOxxvQVtyVeuzXZGey/NoPxNXB6Co1rZDvbUZHUtK0N26ELj/leUnqDoCDM96GpOd/fRHbwInDEfWTudB8t2CQzjV2mcrWfHtrukgFzlNDFUmMfxn7Kk1E6cWyXC9vqUs=;
- In-reply-to: <20070711121632.58a8ecdf@xxxxxxxxxxxxxx>
- Mail-followup-to: Zsh Hackers' List <zsh-workers@xxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <f36b08ee0707110152m7f7b7215j364d469209793c27@xxxxxxxxxxxxxx> <20070711112512.3abd2809@xxxxxxxxxxxxxx> <20070711121632.58a8ecdf@xxxxxxxxxxxxxx>
On 2007-07-11 at 12:16 +0100, Peter Stephenson wrote:
> if this turns out to be useful. (Note I called it _handle*r* since that
> seemed more natural. A handler is something that handles an error. A
> handle is a reference to a data structure. If it means
> handle_command_not_found it should say so. However, that's just me being
> picky and I'm not particularly bothered.)
> +If no external command is found but a function tt(command_not_found_handler)
> +exists the shell executes this function with all
> +command line arguments.
I think that the Debian bash extender was just as picky.
command_not_found_handle
The name of a shell function to be called if a command cannot be
found. The return value of this function should be 0, if the
command is available after execution of the function, otherwise 127
(EX_NOTFOUND). Enabled only in interactive, non POSIX mode shells.
This is a Debian extension.
So I interpret that as meaning:
unsplat_my_goofs() { blah; return 127; }
command_not_found_handle=unsplat_my_goofs
However, I'm unable to get this to actually work on the Ubuntu-derived
distribution I'm using.
-Phil
Messages sorted by:
Reverse Date,
Date,
Thread,
Author