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

Re: Binding Home and End

On Sat, 30 Jan 2010 12:25:15 +0100
Frank Terbeck <ft@xxxxxxxxxxxxxxxxxxx> wrote:
> Mikael Magnusson wrote:
> > On 29 January 2010 22:41, Frank Terbeck <ft@xxxxxxxxxxxxxxxxxxx> wrote:
> >> Peter Stephenson wrote:
> [...]
> >>> zle-line-init() { echotgi smkx; }
> >>> zle-line-finish() { echoti rmkx; }
> [...]
> >> Is there any potential part of the shell that could break if what the
> >> above functions did were the default behaviour?
> >
> > I imagine it would at least break lots of keybinds for people who don't use
> > terminfo.
> Yes, of course. :)
> I was rather getting at whether doing this was likely to break something
> like menu-selection or something similar. I don't think it would, but
> Peter's mention about "chaos" made me a little uneasy.

Compatibility was really my only worry... congratulations if you've
puzzled out terminal application cursor / keypad modes, but I suspect
99.something % of shell users just look at what sequences a key happens
to be sending and bind their functions to that, so it wouldn't be a good
idea to tinker with those now.

(Although it's certainly arguable, it's not completely clear that a
shell's line editor is an "application" in the strict sense, the whole
distinction being a not very happy historical accident in the first
place.  The way shells evolved means that to begin with they were just
using raw input; at some point they crossed the boundary to become
something more sophisticated.  The simple application / raw distinction
doesn't really fit.)

If you're not relying on the particular O / [ key sequence you're
getting at the moment, however, as far as I know the shell code I gave
should work fine for you (obviously, do let us know if you find a

This is probably worth mentioning in the FAQ.

Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
Web page now at http://homepage.ntlworld.com/p.w.stephenson/

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