Re: [dev] [st] zsh and del/pos1 key

2013-01-18 Thread Christoph Lohmann
Greetings.

On Fri, 18 Jan 2013 19:23:24 +0100 Roberto E. Vargas Caballero 
k...@shike2.com wrote:
  This works for Del in bash.
  But it doesn't fix Pos1 or Del in zsh.
 
 
 You can find the information in the zsh FAQ
 (http://zsh.sourceforge.net/FAQ/zshfaq03.html#l25) about how get it working
 with terminals with smkx and rmkx sequences.
 
 I also add the patch to the st FAQ with the information.

The patch is applied. I had to modify it because you were patching about
a wrong version of the FAQ.


Sincerely,

Christoph Lohmann




Re: [dev] [st] zsh and del/pos1 key

2013-01-14 Thread Roberto E. Vargas Caballero
 This works for Del in bash.
 But it doesn't fix Pos1 or Del in zsh.


You can find the information in the zsh FAQ
(http://zsh.sourceforge.net/FAQ/zshfaq03.html#l25) about how get it working
with terminals with smkx and rmkx sequences.

I also add the patch to the st FAQ with the information.
From 6c8ebf8f9e8842a1278a769fce18408702082fdb Mon Sep 17 00:00:00 2001
From: Roberto E. Vargas Caballero k...@shike2.com
Date: Mon, 14 Jan 2013 11:37:18 +0100
Subject: [PATCH] Add information about zsh keymap solution

In the FAQ you can find some information about how get your bugsy bash be
able of reading Del key, and this patch adds the same information for the
also bugsy zsh. It also change the echo command by a standard printf without
special characters, so it is possible copy and paste the commands to the
shell.
---
 FAQ |   29 -
 1 file changed, 24 insertions(+), 5 deletions(-)

diff --git a/FAQ b/FAQ
index e630d9f..f7476dc 100644
--- a/FAQ
+++ b/FAQ
@@ -55,10 +55,11 @@ programs which want to test against keypad keys, have to send these
 sequences. But bugsy bash and irssi for example don't do it. A fast
 solution is write this command:
 
-	$ echo ^[?1h^[= /dev/tty
+	$ printf \033?1h\033= /dev/tty
 
-And all the problems will be removed. In the case of bash reading the
-manpage of readline you can see this text:
+And all the problems will be removed.
+
+In the case of bash reading the manpage of readline you can see this text:
 
enable-keypad (Off)
 		When set to On, readline will try to enable the
@@ -66,6 +67,24 @@ manpage of readline you can see this text:
 		need this to enable the arrow keys.
 
 so, adding this option in your .inputrc you will fix the problem with
-all applications which use readline. In the case of irssi this tip will
-not help.
+all applications which use readline.
+
+You can read in the zsh FAQ (http://zsh.sourceforge.net/FAQ/zshfaq03.html#l25):
+
+	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 by these keys from the system's terminal database, terminfo.
+	Unfortunately, the key sequences given there typically 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 the scope of this FAQ, but if you wish 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 }
+		function zle-line-finish () { echoti rmkx }
+		zle -N zle-line-init
+		zle -N zle-line-finish
+
+So putting these options in your .zshrc you will fix the problem.
 --
-- 
1.7.10.4



Re: [dev] [st] zsh and del/pos1 key

2013-01-07 Thread Roberto E. Vargas Caballero
On Mon, Jan 07, 2013 at 08:47:08AM +0100, Roberto E. Vargas Caballero wrote:
 On Sun, Jan 06, 2013 at 09:43:49PM +0400, p37si...@lavabit.com wrote:
  This patch fixes it for me.  Don't know how to fix it correctly yet.

 Please take a look to this message in the list:

http://lists.suckless.org/dev/1212/13848.html


 Maybe we should add the information in the FAQ.


And here is the patch.
From 5fc234fb9674ded207fb39964b23d9eeec94bd8f Mon Sep 17 00:00:00 2001
From: Roberto E. Vargas Caballero k...@shike2.com
Date: Mon, 7 Jan 2013 09:07:52 +0100
Subject: Add info about Del key in the FAQ.

---
 FAQ |   31 +++
 1 file changed, 31 insertions(+)

diff --git a/FAQ b/FAQ
index b624145..e630d9f 100644
--- a/FAQ
+++ b/FAQ
@@ -37,4 +37,35 @@ back mode aka “copy mode”, it’s C-a ESC. You probably want defscrollback
 [0] http://en.wikipedia.org/wiki/GNU_Screen
 [1] http://en.wikipedia.org/wiki/Tmux
 --
+Why Del key doesn't work in some programs?
 
+Taken from terminfo:
+
+	If the terminal has a keypad that transmits codes when the keys
+	are pressed, this information can be given. Note that it is not
+	possible to handle terminals where the keypad only works in
+	local (this applies, for example, to the unshifted HP 2621 keys).
+	If the keypad can be set to transmit or not transmit, give these
+	codes as smkx and rmkx. Otherwise the keypad is assumed to
+	always transmit.
+
+
+In our case smkx=\E[?1h\E= and rmkx=\E[?1l\E, so it is mandatory that
+programs which want to test against keypad keys, have to send these
+sequences. But bugsy bash and irssi for example don't do it. A fast
+solution is write this command:
+
+	$ echo ^[?1h^[= /dev/tty
+
+And all the problems will be removed. In the case of bash reading the
+manpage of readline you can see this text:
+
+   enable-keypad (Off)
+		When set to On, readline will try to enable the
+		application keypad when it is called. Some systems
+		need this to enable the arrow keys.
+
+so, adding this option in your .inputrc you will fix the problem with
+all applications which use readline. In the case of irssi this tip will
+not help.
+--
-- 
1.7.10.4



Re: [dev] [st] zsh and del/pos1 key

2013-01-07 Thread ilf

Roberto E. Vargas Caballero:
  http://lists.suckless.org/dev/1212/13848.html 


This works for Del in bash.
But it doesn't fix Pos1 or Del in zsh.

--
ilf

Über 80 Millionen Deutsche benutzen keine Konsole. Klick dich nicht weg!
-- Eine Initiative des Bundesamtes für Tastaturbenutzung


signature.asc
Description: Digital signature


Re: [dev] [st] zsh and del/pos1 key

2013-01-07 Thread Roberto E. Vargas Caballero
 Roberto E. Vargas Caballero:
   http://lists.suckless.org/dev/1212/13848.html

 This works for Del in bash.
 But it doesn't fix Pos1 or Del in zsh.


Even echo ^[?1h^[= /dev/tty command? (^[ means \01b, you can get it using ^v 
Esc)

In the thread we agreed that we should point the bug to the programs which
don't handle correctly the keypad, so you could send a patch request to zsh.


Best regards,



[dev] [st] zsh and del/pos1 key

2013-01-06 Thread ilf
For me, in st (current git) the Pos1 and Del keys don't work in an 
interactive zsh. End and Backspace work though.


In bash, Pos1 works, but Del doesn't.

In vim, everything works.

Can anyone reproduce this? Any hint on how to debug/fix?

--
ilf

Über 80 Millionen Deutsche benutzen keine Konsole. Klick dich nicht weg!
-- Eine Initiative des Bundesamtes für Tastaturbenutzung


signature.asc
Description: Digital signature


Re: [dev] [st] zsh and del/pos1 key

2013-01-06 Thread p37sitdu
On Sun, Jan 06, 2013 at 04:39:57PM +0100, ilf wrote:
 For me, in st (current git) the Pos1 and Del keys don't work in an
 interactive zsh. End and Backspace work though.
 
 In bash, Pos1 works, but Del doesn't.
 
 In vim, everything works.
 
 Can anyone reproduce this? Any hint on how to debug/fix?

In latest git version del doesn't work in bash. In st-0.3 it works.

Looks like it can be found with git bisect.

Haven't noticed it before, used ^D all the time.




Re: [dev] [st] zsh and del/pos1 key

2013-01-06 Thread p37sitdu
This patch fixes it for me.  Don't know how to fix it correctly yet.
141,142c141,142
   { XK_KP_Delete, XK_ANY_MOD, \033[P,   -1,0,0},
   { XK_KP_Delete, XK_ANY_MOD, \033[3~,  +1,0,0},
---
 /*{ XK_KP_Delete, XK_ANY_MOD, \033[P,   -1,0,0},*/
   { XK_KP_Delete, XK_ANY_MOD, \033[3~,   0,0,0},
197,198c197,198
   { XK_Delete,XK_ANY_MOD, \033[P,   -1,0,0},
   { XK_Delete,XK_ANY_MOD, \033[3~,  +1,0,0},
---
 /*{ XK_Delete,XK_ANY_MOD, \033[P,   -1,0,0},*/
   { XK_Delete,XK_ANY_MOD, \033[3~,   0,0,0},


Re: [dev] [st] zsh and del/pos1 key

2013-01-06 Thread Roberto E. Vargas Caballero
On Sun, Jan 06, 2013 at 09:43:49PM +0400, p37si...@lavabit.com wrote:
 This patch fixes it for me.  Don't know how to fix it correctly yet.

Please take a look to this message in the list:

   http://lists.suckless.org/dev/1212/13848.html


Maybe we should add the information in the FAQ.