Bug 124803

Summary: konsole sends wrong esc-sequences for home and end + fix
Product: [Fedora] Fedora Reporter: Hans de Goede <hdegoede>
Component: kdebaseAssignee: Than Ngo <than>
Status: CLOSED NEXTRELEASE QA Contact: Ben Levenson <benl>
Severity: medium Docs Contact:
Priority: medium    
Version: 2   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
URL: http://bugs.kde.org/show_bug.cgi?id=65067
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-07-19 09:22:30 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Patch fixing the described problems none

Description Hans de Goede 2004-05-30 13:38:10 UTC
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:
http://bugs.kde.org/show_bug.cgi?id=65067
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 13:39:07 UTC
Created attachment 100705 [details]
Patch fixing the described problems

Comment 2 Hans de Goede 2004-06-02 14:36:19 UTC
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 11:06:56 UTC
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 Than Ngo 2004-07-19 09:10:00 UTC
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 09:22:30 UTC
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
this.

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 Than Ngo 2004-07-19 10:05:34 UTC
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 @@
     scr->setHistCursor(scr->getHistLines());

   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);
     return;
   }


Comment 7 Hans de Goede 2004-07-19 12:20:37 UTC
Yes,

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 Than Ngo 2004-07-19 12:34:00 UTC
this patch is still in kdebase ;-)