Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: "lock" command line
- X-seq: zsh-users 12712
- From: "Mikael Magnusson" <mikachu@xxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: "lock" command line
- Date: Fri, 14 Mar 2008 19:35:39 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=/M779rUOX+upbdmNINoyYEWd5oIlV68xRf1/aKqNPDg=; b=srzqu1Eco8QGqEzRKAiqVjwqO50IQLahOvVu7hwZt2GWn147280Oqr/Ie6yEKfbYQlgYYCsTeUzc0/Z44aSEApqJQRQf6D6FEwqUzT8FhAcYtce6/mBuGJe5V9HY3rjAi6SfFioVDcT2eY9SaFTxEranaxj0MtxN8p9VZF/vP9Q=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=AOBkmBS5AYmybZwwhW3j2Zs9sV/xAIwNHbZp/6BDOlQXxTktP7a71EwlmeLwXyObEUcrPZeWESGS6O+W65V+Xz5b4NnggcrdctUHN8GnRDaBNijO9Jz/eQej0dd7Y6VPysS0X2y/EOL9c5YLKaFaxlNJA+hu6lRfW2DQE/dQSII=
- In-reply-to: <20080314182557.GA5351@xxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <20080314182557.GA5351@xxxxxxxxxxxx>
On 14/03/2008, Eric Smith <Eric.Smith@xxxxxxxxxxxx> wrote:
> What is a nice way to lock the command line so that accept-line
> does not execute (or whatever). Only when a certain key combination is
> pressed does it "unlock"
Maybe something like this
function _lock() {
unbindkey '^M'
}
function _unlock() {
bindkey '^M' accept-line
}
zle -N lock-accept-line _lock
zle -N unlock-accept-line _unlock
bindkey '^X^L' lock-accept-line
bindkey '^X^U' unlock-accept-line #or whatever binds you want
I can make something more general if you want to disable all widgets
that accept the line, based on my own weird accept-line :).
--
Mikael Magnusson
Messages sorted by:
Reverse Date,
Date,
Thread,
Author