I'm a bit confused about this Delete key issue, to map it to "\177" or
"\033[3~" (or something else). On my Linux laptop, I get tree different
results from pressing the Del key in "vi" from rxvt (here it's correct),
xterm and gnome-terminal (all three sets TERM=xterm). gnome-terminal (or
rather the zvt widget) even treats the "Delete" and "KP_Delete" keys
different (on my laptop I have only one of them). Can anyone shed some light
on this issue, please?
TIA,
- Peter
> I'm a bit confused about this Delete key issue, to map it to "\177" or
> "\033[3~" (or something else). On my Linux laptop, I get tree different
> results from pressing the Del key in "vi" from rxvt (here it's correct),
oh?
(rxvt allows you to compile in more than one value - which is "correct"?)
> xterm and gnome-terminal (all three sets TERM=xterm). gnome-terminal (or
> rather the zvt widget) even treats the "Delete" and "KP_Delete" keys
> different (on my laptop I have only one of them). Can anyone shed some light
> on this issue, please?
the confusion is historical: \177 is DEL (which some of us think "Delete").
the \033[3~ is vt220 "Remove", which others think "Delete".
--
Thomas E. Dickey
dic...@clark.net
http://www.clark.net/pub/dickey
"T.E.Dickey" <dic...@shell.clark.net> wrote in message news:ODHs4.8875$lK6.2...@iad-read.news.verio.net...
> In comp.windows.x.apps Peter 'Luna' Runestig <peter+n...@runestig.com> wrote:
> > Hi all!
>
> > I'm a bit confused about this Delete key issue, to map it to "\177" or
> > "\033[3~" (or something else). On my Linux laptop, I get tree different
> > results from pressing the Del key in "vi" from rxvt (here it's correct),
>
> oh?
> (rxvt allows you to compile in more than one value - which is "correct"?)
With "correct" I just mean "expected behaviour from the application", ie deleting the character at the cursor, not beeping or inserting "^?" instead. The fact that it was rxvt that was "correct" was just because of the terminfo settings.
rxvt was compiled as default: ./configure && make. That gives you "\177" for Backspace and "\033[3~" for delete. You could change those mappings in src/features.h, but there is another problem: On my system, pty's default "backspace" (VERASE) is '\177'. If you try to remap Delete to "\177", the 0xFF byte generated when you press the Delete key will still be regarded as a "backspace". To get around this, you must change the VERASE setting in the pty to something else, say 0x08, like you do in xterm. But rxvt doesn't do that.
> > xterm and gnome-terminal (all three sets TERM=xterm). gnome-terminal (or
> > rather the zvt widget) even treats the "Delete" and "KP_Delete" keys
> > different (on my laptop I have only one of them). Can anyone shed some light
> > on this issue, please?
>
> the confusion is historical: \177 is DEL (which some of us think "Delete").
> the \033[3~ is vt220 "Remove", which others think "Delete".
This is from the changelog for xterm in the XFree86 source distribution:
1998/6/28: <snip> change string for kdch1 from \177 to \E[3~, to address complaints from Debian developers. (This applies to the key labeled "Delete", and does not affect the backarrow key).
This was again changed back somewhere between 3.3.3 and 3.3.5 (thus confusing me). And today I looked at the XFree86 3.9.18 snapshot. In xterm patches 124 through 127, this changes again. Now it seems more or less back to the 3.3.3 style, with the addition of this being runtime configurable. And building xterm from the 3.9.18 snapshot gives me back the xterm I was used to.
- Peter
> "T.E.Dickey" <dic...@shell.clark.net> wrote in message news:ODHs4.8875$lK6.2...@iad-read.news.verio.net...
>> In comp.windows.x.apps Peter 'Luna' Runestig <peter+n...@runestig.com> wrote:
>> > Hi all!
>>
>> > I'm a bit confused about this Delete key issue, to map it to "\177" or
>> > "\033[3~" (or something else). On my Linux laptop, I get tree different
>> > results from pressing the Del key in "vi" from rxvt (here it's correct),
>>
>> oh?
>> (rxvt allows you to compile in more than one value - which is "correct"?)
> With "correct" I just mean "expected behaviour from the
> application", ie deleting the character at the cursor, not beeping
> or inserting "^?" instead. The fact that it was rxvt that was
> "correct" was just because of the terminfo settings.
> rxvt was compiled as default: ./configure && make. That gives you
> "\177" for Backspace and "\033[3~" for delete. You could change
And X11R6 xterm does ^H and \177, respectively. At the time that I started
working on xterm (early 1996), these issues were not much discussed, but
one goal was to keep XFree86 xterm "compatible" with X11R6 - but that
conflicts with the goal to make it "compatible" with vt220.
> This is from the changelog for xterm in the XFree86 source
> distribution: 1998/6/28: <snip> change string for kdch1 from \177
> to \E[3~, to address complaints from Debian developers. (This
> applies to the key labeled "Delete", and does not affect the
> backarrow key).
yes (at that point, most of the discussion about "Delete" was confusion
over the backarrow key versus backspace and DEL).
> This was again changed back somewhere between 3.3.3 and 3.3.5 (thus
> confusing me). And today I looked at the XFree86 3.9.18 snapshot.
Around that point, I had introduced the first iteration of the
Sun/PC versus VT220 keyboard toggle - the terminfo has some of the
latter's keybindings though that keyboard configuration was not the
default in the released code. I corrected the trunk (3.9.x) version,
but overlooked a followup fix for the "stable" 3.3.x version til
recently (after a bug report). I _think_ that's the source of the
confusion: by changing a resource setting, you can get either behavior.
> In xterm patches 124 through 127, this changes again. Now it seems
> more or less back to the 3.3.3 style, with the addition of this
> being runtime configurable. And building xterm from the 3.9.18
> snapshot gives me back the xterm I was used to.
yes (124-127 took a couple of tries before I could reconcile the conflicting
goals).