Bug 3275 - how to set meta-delete key binding
Summary: how to set meta-delete key binding
Keywords:
Status: CLOSED DEFERRED
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: tcsh
Version: 5.2
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Eido Inoue
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 1999-06-04 20:21 UTC by Joe Harrington
Modified: 2008-05-01 15:37 UTC (History)
0 users

Fixed In Version:
Clone Of:
Environment:
Last Closed: 1999-09-02 18:08:08 UTC
Embargoed:


Attachments (Terms of Use)

Description Joe Harrington 1999-06-04 20:21:08 UTC
I've been trying to set the key binding for meta-delete.
I'm running in an xterm and have used xmodmap to cause both
backspace and delete to issue delete (0xff) in vt100-type
windows.  This fixes a lot of things and the only thing that
this breaks is meta-backspace in tcsh.  So I need to set
meta-delete in tcsh but tcsh appears not to allow it to be
set.

The tcsh man page states that delete is given as ^? and that
you can say bindkey -b 'M-<keyname>' <command> to set meta
keys.
However:
% bindkey -b 'M-^?' backward-delete-word
Bad key spec M-^?

If I use ^V to quote the meta-delete sequence, I get ^H,
which is backspace (0x08), not delete (0xff).  Using ^H in
any bindkey command affects backspace but not delete.
Doing just bindkey to list the sequences lists a bunch of
meta sequences like "^^g".  Perhaps one of these is what I
want but I have no way of knowing which of those sequences
corresponds to meta-delete, nor do I know how to generate
them.  Cutting and pasting them works to some windows, but
not to shell windows.

The man page tells you how to set delete and anything with a
meta in front of it, but combining those rules does not
work.  Please fix, or suggest (and document in the man page)
another way.

Thanks!

Comment 1 Jeff Johnson 1999-06-05 16:11:59 UTC
Have you tried entering the command all in ascii? By that I mean
instead of trying to get the code \0xff into the command, try
the key sequence
	M
	-
	^	caret
	?	question mark

when entering your bindkey command?


------- Email Received From  Joe Harrington <jh.cornell.edu> 06/07/99 11:57 -------

Comment 2 Joe Harrington 1999-06-07 16:05:59 UTC
(Here's the contents of the email I sent.  Sorry, I thought it would
appear in the dialog.)

Yes I tried, no it doesn't work.  Trying this suggestion will show
that it produces the following error message:

% bindkey -b 'M-^?' backward-delete-character
Bad key spec M-^?

I tried both the quoted key sequences and the ascii equivalents for
^?, ^H, ^h, ^_, M-DL, M-DEL, M-0xff, and all of the "untypable"
foreign characters that show up when you do bindkey without arguments,
by cut-and-paste from the window.

Apparently bindkey -b limits the sequence to three characters, and
they have to be printable.  The sequence 'M-C-s' fails, for example.
My belief is that there is an anti-loophole in the key codes for
bindkey: You can only tell bindkey to use "meta" in the -b format, and
you can only tell bindkey about delete using ^?.  This latter sequence
is documented but is disallowed by the -b format, so meta-delete isn't
possible.  DEL is the only ascii sequence that is not printable and
that is not in the first ascii register (values 0x00 - 0x1f).

A very easy fix to code would be to extend the -b option to include 1)
the standard ASCII two- and three-letter expansions of the control
characters (NUL, SOH, STX, etc.), 2) Multiple "shift"-style prefixes
(M-C-x), and/or 3) hex values in the "0x" format (M-0xff).

Comment 3 Jeff Johnson 1999-09-02 18:08:59 UTC
This won't be in Red Hat 6.1. I'm preserving the bug by changing the
state to REMIND.


Note You need to log in before you can comment on or make changes to this bug.