[comp.unix.shell] tcsh binding of function keys

gamin@ireq-robot.hydro.qc.ca (Martin Boyer) (11/07/90)

I just got the latest (5.19) version of tcsh and I have problems
binding SUN function keys.  In the following example, I want to bind
R7 to beginning-of-line:

% bind function-key-prefix M-[
% bind beginning-of-line X-214z
bad key specification -- unknown name ""


The man page says:

     If given two arguments bind binds the function (first  argu-
     ment)  to  the given key (second argument).  The key may be:
     the direct character or a caret-<letter> combination,  which
     is  converted to control-<letter>; M-<letter> for an escaped
     character; or X-<string> for a function key.  For  the  last
     of these, the function key prefix must be bound to the func-
     tion "extended-key-prefix" and the string specified  to  the
     bind  command  must not include this prefix.

Notice how it says "M-<letter>" and "X-<string>".  I understand this
to mean that the M- prefix can be followed only by a single letter but
that the X- prefix can be followed by a string.  I believe the
documentation is wrong but, anyhow, is there a workaround?

I know about .ttyswrc mapping, but I can't use that on a raw console.

-- 
Martin Boyer                            mboyer@ireq-robot.hydro.qc.ca
Institut de recherche d'Hydro-Quebec    mboyer@ireq-robot.uucp
Varennes, QC, Canada   J3X 1S1
+1 514 652-8136

jak@cs.brown.edu (Jak Kirman) (11/09/90)

It appears to be an error in the documentation.  The clue is in the
output from bind, where the arrow keys are listed as "F-A", "F-B", etc;
they generate the sequences ^[[A, ^[B, etc.

My F9 key generates ^[[20~, so I tried:

        > bind downcase-word F-20~

This worked fine.

It seems that bind X-<?> is equivalent to bind ^X<?>; it just binds the
keystrokes prefixed by ctrl-x.

                                Jak                            jak@cs.brown.edu
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The middle of the road is all of the usable surface.  The extremes,
right and left, are in the gutters.
                                                    -- Dwight D. Eisenhower