Bug 124803 - konsole sends wrong esc-sequences for home and end + fix
konsole sends wrong esc-sequences for home and end + fix
Product: Fedora
Classification: Fedora
Component: kdebase (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Ngo Than
Ben Levenson
Depends On:
  Show dependency treegraph
Reported: 2004-05-30 09:38 EDT by Hans de Goede
Modified: 2007-11-30 17:10 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2004-07-19 05:22:30 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Patch fixing the described problems (15.12 KB, patch)
2004-05-30 09:39 EDT, Hans de Goede
no flags Details | Diff

  None (edit)
Description Hans de Goede 2004-05-30 09:38:10 EDT
xterm cloning terminalemulators such as konsole and gnome-terminal
have always had inconcistent esc-sequences for the home and end keys.
Back in the 6.2 / 7.x days I worked with RedHat to make them al behave
identical/concistent. Back then we decioded to follow the debian
keyboard guidelines for home and end.

In the current FC2 state there are 2 problems with home and end when
used form xterm clones. 

1) there is no terminfo entry for these keys in the xterm terminfo
entry, see bug 122815

2) xterm still sends the debiankeyb guideline sequences for home and
end, gnome-terminal gets its sequences from terminfo so once 1) is
fixed gnome-terminal also behaves correct, but konsole has the wrong
esc-sequences hardcoded in it.

I'll attach a patch which fixes the esc-sequences for home and end,
and also adds seperate esc-sequences for keypadkeys with a modifier
(alt-home, alt-left, ctrl-right etc) this for example allows one todo
ctrl-left or ctrl-right for word navigation in bash.

I've also submitted this patch upstream, see:
This is worth the time to read!

Note this patch replaces(incorperates) my earlier double-esc fix
patch, because it was written to fix problems reported when merging
the double-esc-patch upstream.
Comment 1 Hans de Goede 2004-05-30 09:39:07 EDT
Created attachment 100705 [details]
Patch fixing the described problems
Comment 2 Hans de Goede 2004-06-02 10:36:19 EDT
Note that this bug was already fixed in the past see bug 63473, but
has resurfaced because patches seem to be blindly dropped when going
to newer upstream versions. (also see my rant in bug 122815)
Comment 3 Hans de Goede 2004-07-17 07:06:56 EDT
Please don't apply my patch, because of changes which are the result
of bug 122815 and the discussion there the attached patch now has the
wrong esc-sequences for home and end.

I'll write a new patch soon.
Comment 4 Ngo Than 2004-07-19 05:10:00 EDT
Hi Hans, ok i have disable your patch now and will enable it again
when i get the new one ;-) thanks

Comment 5 Hans de Goede 2004-07-19 05:22:30 EDT
Actually bug 122815 once resolved will also fix the home/end problem
for konsole. Konsole then still needs work to be more xterm
compatible, but that is another story and another bug. So I'm closing

BTW I hope when you say you've dropped my patch you mean the patch
I've attched to this bug, which indeed now is plain wrong, the
double-esc patch is still needed.
Comment 6 Ngo Than 2004-07-19 06:05:34 EDT
do you mean this patch?

--- kdebase-3.1.3/konsole/konsole/TEmuVt102.cpp.hdg     2003-09-26
23:51:33.000000000 +0200
+++ kdebase-3.1.3/konsole/konsole/TEmuVt102.cpp 2003-09-26
23:56:40.000000000 +0200
@@ -904,7 +904,10 @@

   if (cmd==CMD_send) {
-    if ((ev->state() & AltButton) && !metaspecified ) sendString("\033");
+    if ( (ev->state() & AltButton) &&
+      !metaspecified &&
+      !(len && txt[0]==27) )
+      sendString("\033");
     emit sndBlock(txt,len);
Comment 7 Hans de Goede 2004-07-19 08:20:37 EDT

That is the double-esc patch and is still needed. I'm trying to get it
integrated upstream, but sofar this hasn't happened yet.
Comment 8 Ngo Than 2004-07-19 08:34:00 EDT
this patch is still in kdebase ;-)

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