zsh-workers
 help / color / mirror / code / Atom feed
* bindkey
@ 2001-06-21 16:26 Pierpaolo Righini
  2001-06-21 17:15 ` bindkey Michal Maru¹ka
  2001-06-21 18:33 ` bindkey Bart Schaefer
  0 siblings, 2 replies; 7+ messages in thread
From: Pierpaolo Righini @ 2001-06-21 16:26 UTC (permalink / raw)
  To: zsh-workers

Dears zsh-workers,
for the first time I experienced a problem using the z-shell with the
distribution red-hat 6.2, infact some of the keys of my keyboard don't
work, in particular almost all the keys apart the usual ones, i.e. the
F1....F12 keys, the keypad and the keys that (usually and in my
keyboard) are situated over the arrow keys: the page-up and page-down keys
that under zsh are very useful to complete the possible command
names. When I press these keys I only get: ~ 
I suspect some configuration files are missing, could some of tou give me  
some idea?  Thanks a lot for everything you can suggest me!  

   Pierpaolo Righini



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

* Re: bindkey
  2001-06-21 16:26 bindkey Pierpaolo Righini
@ 2001-06-21 17:15 ` Michal Maru¹ka
  2001-06-21 18:40   ` bindkey Bart Schaefer
  2001-06-22 11:59   ` bindkey Pierpaolo Righini
  2001-06-21 18:33 ` bindkey Bart Schaefer
  1 sibling, 2 replies; 7+ messages in thread
From: Michal Maru¹ka @ 2001-06-21 17:15 UTC (permalink / raw)
  To: Pierpaolo.Righini; +Cc: zsh-workers


Hi Pierpaolo,
yesterday i solved the same problem on my wife's computer. I do not use these keys,
as they are quite distant (i prefer control/meta combinations).

So you have got some keys, which do not do what you expect. Let's bind them to
what we want. But what are the codes of the keys?

Ask the zsh what coded these keys produce: 
you> type: M-x (M- stands for meta or alt key  -x means contemporary press the letter x)
zsh> says: execute:_
you> type: describe-key-briefly
zsh> says: Describ key briefly: _
you> press the key which bothers you. e.g Home
zsh> says:  "^[[1" is undefined-key

but you want it to go to the beginning of the line, so you must bind it:

    bindkey "^[[1" beginning-of-line
Note that ^[ is 1 character (escape), so you must quote it (i do it in emacs).

after this the key will do what you want, but it still insert the ~. So I think
that describe-key-briefly did not report all the key sequence. Let's append it
    bindkey "^[[1~" beginning-of-line
Now it works!
Do the same with other keys. Well you need to consult some guide to know the
names of functions ... sorry


extract from ~/.zprofile:

bindkey "^[[1~" beginning-of-line
bindkey "^[[4~" end-of-line
bindkey "^[[3~" delete-char


ciao.


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

* Re: bindkey
  2001-06-21 16:26 bindkey Pierpaolo Righini
  2001-06-21 17:15 ` bindkey Michal Maru¹ka
@ 2001-06-21 18:33 ` Bart Schaefer
  1 sibling, 0 replies; 7+ messages in thread
From: Bart Schaefer @ 2001-06-21 18:33 UTC (permalink / raw)
  To: Pierpaolo Righini, zsh-workers

On Jun 21,  6:26pm, Pierpaolo Righini wrote:
} Subject: bindkey
}
} F1....F12 keys, the keypad and [...] the page-up and page-down keys
} that under zsh are very useful to complete the possible command
} names.

The only key that's normally bound to do completion is TAB, so I'm not
sure what you're referring to here.  Do you have some key bindings of
your own for these keys, that have stopped working?

} for the first time I experienced a problem using the z-shell with the
} distribution red-hat 6.2

Did you recently install or upgrade to redhat 6.2?  There were a number
of changes to the configuration of xterm introduced in 6.2, mostly to
handle the scrolling wheel on the Microsoft Intellimouse.  This may be
affecting your key bindings.

If you're using the zsh distributed with RH 6.2, that would be zsh 3.0.7,
correct?

} When I press these keys I only get: ~ 

Do you normally use emacs keybindings, or vi keybindings?  The above makes
me think that you've got vi bindings in effect, which may not be what you
were expecting.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   


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

* Re: bindkey
  2001-06-21 17:15 ` bindkey Michal Maru¹ka
@ 2001-06-21 18:40   ` Bart Schaefer
  2001-06-22 11:59   ` bindkey Pierpaolo Righini
  1 sibling, 0 replies; 7+ messages in thread
From: Bart Schaefer @ 2001-06-21 18:40 UTC (permalink / raw)
  To: "Michal Maru¹ka", Pierpaolo.Righini; +Cc: zsh-workers

On Jun 21,  7:15pm, Michal Maru¹ka wrote:
}
} Ask the zsh what coded these keys produce: 
} you> type: M-x (M- stands for meta or alt key  -x means contemporary press the letter x)
} zsh> says: execute:_
} you> type: describe-key-briefly
} zsh> says: Describ key briefly: _
} you> press the key which bothers you. e.g Home
} zsh> says:  "^[[1" is undefined-key
} 
} describe-key-briefly did not report all the key sequence.

Hmm, this is a bit of a thorny problem:  describe-key-briefly only works
correctly for keys which are bound to something.  For keys that are not
bound, the search through the key tables stops as soon as it finds that
the prefix is not bound, without consuming the remaining characters of
the multi-key sequence.

Of course zsh has no way of knowing that it should treat \e[1~ as all one
sequence before it is bound to something; it can't tell how many keys you
pressed to cause that to appear.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   

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

* Re: bindkey
  2001-06-21 17:15 ` bindkey Michal Maru¹ka
  2001-06-21 18:40   ` bindkey Bart Schaefer
@ 2001-06-22 11:59   ` Pierpaolo Righini
  2001-06-22 12:14     ` bindkey Michal Maru¹ka
  1 sibling, 1 reply; 7+ messages in thread
From: Pierpaolo Righini @ 2001-06-22 11:59 UTC (permalink / raw)
  To: Michal Maru¹ka; +Cc: zsh-workers

Hi Michal,

so after on your wife's computer now you have solved the problem on my
computer too!! Thanks a lot! Indeed what I really needed is the way to
obtain the code of the various keys.
In fact in my case I had this problem only when I was forced to change
computer and RH version (from 6.1 to 6.2), so it was easy to find all the
name of the functions that were correctly bound on my old computer
running RH 6.1, and using your simple trick I got for example:
           "^[[6~" is history-search-forward  
(so including the ~ character), so of course with the command 

           bindkey "^[[6~" history-search-forward

and all the other similar ones everything is ok now.
Ciao. 
        Pierpaolo 




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

* Re: bindkey
  2001-06-22 11:59   ` bindkey Pierpaolo Righini
@ 2001-06-22 12:14     ` Michal Maru¹ka
  2001-06-22 13:09       ` bindkey Sven Wischnowsky
  0 siblings, 1 reply; 7+ messages in thread
From: Michal Maru¹ka @ 2001-06-22 12:14 UTC (permalink / raw)
  To: Pierpaolo.Righini; +Cc: zsh-workers



Pierpaolo Righini writes:
>computer too!! Thanks a lot! Indeed what I really needed is the way to
>obtain the code of the various keys.


Bart Schaefer writes>
> Hmm, this is a bit of a thorny problem:  describe-key-briefly only works
> correctly for keys which are bound to something.  For keys that are not
> bound, the search through the key tables stops as soon as it finds that
> the prefix is not bound, without consuming the remaining characters of
> the multi-key sequence.


Given this situation, I think the way to know the sequence (sent by a key) is to
look at the configuration of the terminal (emulator), In case your problem is with Xterm,
see the file (in XFree 4.0.2):

   /etc/X11/app-defaults/XTerm

mine contains:
*VT100*translations:    #override \
....(lines skipped)
<KeyPress> Home: string("^[[1~") \n\
<KeyPress> End: string("^[[4~") \n\
Ctrl <KeyPress> Home: string("^[[88~") \n\
Ctrl <KeyPress> End: string("^[[87~") \n\
Shift <KeyPress> Right: string("^[r") \n\
Ctrl <KeyPress> Right: string("^[[`3") \n\
Ctrl <Key> Left: string("^[[`2") \n\



IIRC in XFree 3.xx it was:
      /usr/X11/lib/X11/app-defaults/XTerm 




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

* Re: bindkey
  2001-06-22 12:14     ` bindkey Michal Maru¹ka
@ 2001-06-22 13:09       ` Sven Wischnowsky
  0 siblings, 0 replies; 7+ messages in thread
From: Sven Wischnowsky @ 2001-06-22 13:09 UTC (permalink / raw)
  To: zsh-workers

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 939 bytes --]

Michal Maru¹ka wrote:

> Pierpaolo Righini writes:
> >computer too!! Thanks a lot! Indeed what I really needed is the way to
> >obtain the code of the various keys.
> 
> 
> Bart Schaefer writes>
> > Hmm, this is a bit of a thorny problem:  describe-key-briefly only works
> > correctly for keys which are bound to something.  For keys that are not
> > bound, the search through the key tables stops as soon as it finds that
> > the prefix is not bound, without consuming the remaining characters of
> > the multi-key sequence.
> 
> 
> Given this situation, I think the way to know the sequence (sent by a key) is to
> look at the configuration of the terminal (emulator), In case your problem is with Xterm,
> see the file (in XFree 4.0.2):

Or just invoke `cat -v' without arguments and you should be able to see
the sequences on the terminal.


Bye
  Sven


-- 
Sven Wischnowsky                         wischnow@informatik.hu-berlin.de


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

end of thread, other threads:[~2001-06-22 13:10 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-06-21 16:26 bindkey Pierpaolo Righini
2001-06-21 17:15 ` bindkey Michal Maru¹ka
2001-06-21 18:40   ` bindkey Bart Schaefer
2001-06-22 11:59   ` bindkey Pierpaolo Righini
2001-06-22 12:14     ` bindkey Michal Maru¹ka
2001-06-22 13:09       ` bindkey Sven Wischnowsky
2001-06-21 18:33 ` bindkey Bart Schaefer

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).