zsh-users
 help / color / mirror / code / Atom feed
* How to bindkey Ctrl-[
@ 2023-10-19 15:46 Thomas Lauer
  2023-10-19 16:29 ` Peter Stephenson
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas Lauer @ 2023-10-19 15:46 UTC (permalink / raw)
  To: Zsh Users

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?

-- 
Thanks T


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: How to bindkey Ctrl-[
  2023-10-19 15:46 How to bindkey Ctrl-[ Thomas Lauer
@ 2023-10-19 16:29 ` Peter Stephenson
  2023-10-20 17:02   ` Thomas Lauer
  0 siblings, 1 reply; 3+ messages in thread
From: Peter Stephenson @ 2023-10-19 16:29 UTC (permalink / raw)
  To: Zsh Users

> On 19/10/2023 16:46 Thomas Lauer <thomas.lauer@virgin.net> 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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: How to bindkey Ctrl-[
  2023-10-19 16:29 ` Peter Stephenson
@ 2023-10-20 17:02   ` Thomas Lauer
  0 siblings, 0 replies; 3+ messages in thread
From: Thomas Lauer @ 2023-10-20 17:02 UTC (permalink / raw)
  To: Zsh Users

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

> > On 19/10/2023 16:46 Thomas Lauer <thomas.lauer@virgin.net> 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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-10-20 17:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-19 15:46 How to bindkey Ctrl-[ Thomas Lauer
2023-10-19 16:29 ` Peter Stephenson
2023-10-20 17:02   ` Thomas Lauer

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).