Re: [dev] [st] delele behaves as backspace... again

From: Nils R <>
Date: Thu, 06 Nov 2014 20:46:08 +0100

Am 03.11.2014 11:06 schrieb
> > Hi folks,
> >
> >  my delete-key behaves as backspace since commit
> >  9d9e049eac3dacb2725f9d792f7cdd2230062313 on all my linux machines
> >  (debian, fedora, ubuntu) and openbsd.
> >  i had this problem in the past (and wrote to this list about it), and
> >  my .zshrc since then contains stty erase ^H:
> It helps with the correct defininition of backspace (from kernel point of view),
> but it is not related to delete key. I suspect zsh sets your terminal in application
> mode,
> >
> > Output of CTRL-V + DEL (on both openbsd and fedora, both have stty erase = ^H):
> >
> > st, zsh: ^?
> > st, bash: ^[[P
> Yes, zsh sets your terminal in application mode, and the value of kdl1 should be
> checked only in keyboard mode. This is a bug in zsh. You can read this in the
> FAQ:
> If you are using zsh, then read the zsh FAQ <>
> It should be noted that the O / [  confusion can occur with other keys
> such as Home and End. Some systems let you query the key sequences sent
> sent by these keys forom the system's terminal database, terminfo.
> Unfortunately, the key sequences given there tpyically apply to the mode
> that is not the one zsh uses by default (it's the "application" mode rather
> than the ""raw" mode). Explaining the use of terminfo is outside of the scope
> of this FAQ, but if you whish to use the key sequences given there you can
> tell the line editor to turn on "application" mode when it starts and turn it
> off when it stops:
> function zle-line-init () { echoti smkx }
> funcion zle-line-finish() { echoti rmkx }
> zle -N zle-line-init
> zle -N zle-line-finish
> Putting these lines into your .zshr will fix the problems.
> Do you have these lines in your zshrc?
> I have tested this configuration and it is true that it doesn't work,
> but I think I know why.  Readline and zsh are too much smart and think
> that erase key is kbs capability, or ^?, but it shouldn't suppose
> that, because in our case ^?  is delete key.  They are not compliant
> with terminfo database, and it is clearly an error. They try to fix
> a configuration problem and at the end they break the terminal
> word totally.
> At this point there are several solutions here
> - Send a patch to readline and zsh people, although I don't think they are going
> to modify anythyng.
> - Put st always in application mode and modify your terminfo
> definition to match Delete key with ^[[P (the value generated by st
> in application mode). You cannot do that in OpenBSD for example.
> - Use a suckless shell that is terminfo compliant.
> - Modify the keys generated by st. This option is not dificult, because you
> only have to modify the values in your config.h (I think I should put this
> option in the FAQ to).
> Regards,


thanks for your mail(s)! I was out of town for work (unexpectedly) and had no access to my machine with st/zsh. Will reply tomorrow with more details.

Received on Thu Nov 06 2014 - 20:46:08 CET

This archive was generated by hypermail 2.3.0 : Thu Nov 06 2014 - 20:48:07 CET