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

Re: How to bindkey Ctrl-[



From: Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
Date: Thu, 19 Oct 2023 17:29:33 +0100 (BST)

> > On 19/10/2023 16:46 Thomas Lauer <thomas.lauer@xxxxxxxxxx> wrote:
> > I want to bind Ctrl-[ to the set-mark-command widget. Naive first try
> > was this:
> >
> > bindkey "^[" set-mark-command
> >
> > but that binds the widget to Esc (which is indeed "^["). I've tried
> > various ideas but no joy.
> >
> > Is that even possible with my terminal/zsh config?
> 
> The simple answer is no --- they are both character 27 in a stream of
> characters, so the shell can't tell them apart.
> 
> A bit of terminal wizardry to make one look different might be possible,
> but 1. that's terminal specific 2. you're going to have to do it in such a
> way that it doesn't confuse other utilities 3. if you're going that way
> you're probably better grabbing a function key and using that, which
> can be done by a shell binding (there are guides to this around somewhere).
> 
> cheers
> pws

Yeah, I thought as much. No biggie really, I have enough other availabe
bindings.

-- 
Thanks T




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