Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: mapping ctrl-D to <ctrl-W ctrl-D>
- X-seq: zsh-users 14580
- From: Peter Stephenson <pws@xxxxxxx>
- Subject: Re: mapping ctrl-D to <ctrl-W ctrl-D>
- Date: Wed, 18 Nov 2009 12:46:22 +0000
- Cc: Zsh Users <zsh-users@xxxxxxx>
- In-reply-to: <20091118122241.GA16098@xxxxxxxxxxxxx>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- Organization: CSR
- References: <20091118122241.GA16098@xxxxxxxxxxxxx>
On Wed, 18 Nov 2009 13:22:41 +0100
Eric Smith <es@xxxxxxxxxxxx> wrote:
> What is a nice clean way to do this mapping?
> To absolutely close a shell even if spaces or words on this line.
clear-and-exit() {
zle kill-whole-line
exit
}
zle -N clear-and-exit
gives you a ZLE function you can bind a key to. (I presume you don't
really need the exit to be generated by a ^D that looks like an
end-of-file.) You don't actually need to delete the line first, although
it looks neater.
--
Peter Stephenson <pws@xxxxxxx> Software Engineer
Tel: +44 (0)1223 692070 Cambridge Silicon Radio Limited
Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, UK
Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom
Messages sorted by:
Reverse Date,
Date,
Thread,
Author