Bug 138191 - Incompatibilities between konsole and real xterm [patch]
Summary: Incompatibilities between konsole and real xterm [patch]
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: kdebase
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Than Ngo
QA Contact:
URL: http://bugs.kde.org/show_bug.cgi?id=9...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2004-11-05 14:52 UTC by Hans de Goede
Modified: 2007-11-30 22:10 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2005-03-10 10:38:30 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
Patch fixing tthe described inconcistencies (16.46 KB, patch)
2005-02-25 15:07 UTC, Hans de Goede
no flags Details | Diff
Same patch but this time against 3.4.0rc1 (20.07 KB, patch)
2005-03-09 16:02 UTC, Hans de Goede
no flags Details | Diff
improved (bugfree/tested) patch (20.07 KB, patch)
2005-03-10 17:31 UTC, Hans de Goede
no flags Details | Diff
cleaned up patch (17.84 KB, patch)
2005-03-24 20:51 UTC, Hans de Goede
no flags Details | Diff
Patch fixing the described inconcistencies (17.23 KB, patch)
2005-04-19 07:33 UTC, Hans de Goede
no flags Details | Diff

Description Hans de Goede 2004-11-05 14:52:24 UTC
I'm also reporting this here, because the response to similar bug
reports upstream have been lacking. This is reported upstream under:
http://bugs.kde.org/show_bug.cgi?id=92749

For the lack of progress with simular bugs upstream see:
http://bugs.kde.org/show_bug.cgi?id=65067

Notice I'm willing to write a proper fix for this if you're interested
in it, iow if there is a reasonable chance that it will get included
in FC.

Here is the original upstream bugreport for convience:
There are number of incompatibilities between konsole and xterm for
convience I'm listing them all here, lett me know if you want any in a
seperate bug.

Alse see: http://bugs.kde.org/show_bug.cgi?id=65067
Where some of this has already been discussed.

Key (esc) sequence incompatibility:
-Konsole by default sends ASCII DEL instead of CTRL-H (^H), which is
 the official xterm default.
-The ESC sequences send for home and end keys with modifier differ 
 from those send by the official xterm.
-The ESC sequences send for F1 - F12 with modifiers don't honor 
 combinations of modifiers like xterm does, see 
 http://bugs.kde.org/show_bug.cgi?id=65067
-Konsole doesn't send distuingish between cursor keys, insert, page-up
 and page-down without and with modifiers (alt, ctrl, shift).
 The official xterm has different ESC sequences for these keys with 
 modifiers, like the F-keys have.

Comment 1 Than Ngo 2004-11-05 15:06:24 UTC
Hi Hans, it's great if you write the fix for this problem. of course
i'm interested in it ;-)

Comment 2 Hans de Goede 2005-02-25 15:06:08 UTC
It took some time before I had time to write the fix, and then writing
it also took some more time then I had estimated, but here it is (see
attachment).

The patch really consist of 3 parts:
1) modify keytrans.cpp & .h To learn the keytab modifier word AnyMod,
   this because the real xterm can also report combinations of 
   modifiers for certain keys, so we either need 8 keytab lines per
   key or a special keyword for this.
2) modify the default keytab to use the new keyword and fix all
   bugs decribed above.
3) since backspace now sends ^H (like the real xterm) the tty erase
   character needs to be changed from the default ^? to ^H, this
   wasn't possible in the old konsole code, thus I added the 
   following:
   -a setErase member to the TEPty class
   -a getErase member to the TEmuVt102 class and to the TEmulator
    superclass
   -added code to session.cpp which ties these 2 together

That's all folks, please apply!


Comment 3 Hans de Goede 2005-02-25 15:07:00 UTC
Created attachment 111423 [details]
Patch fixing tthe described inconcistencies

Comment 4 Hans de Goede 2005-03-09 16:02:38 UTC
Created attachment 111812 [details]
Same patch but this time against 3.4.0rc1

Upstream requested me to redo the patch against 3.4.0rc1.
Warning not tested /compiled yet, but it should work fine :)

ping?

Comment 5 Than Ngo 2005-03-10 10:38:30 UTC
Great. It's now included in kdebase-3.4.0-0.rc1.5. Thanks for the patch.

Comment 6 Hans de Goede 2005-03-10 17:24:54 UTC
Crap,

I've made the time today to actually compile and test my patch and
there is a bug in it, sorry about this. This bug only shows up
runtime, starting konsole from a terminal gives:
[buildin](27,12):error: Unknown mode name.

This is because shift is spelled without an initial captial in
README.default.Keytab one time and thus also gets spelled without a
capital in the generated default.keytab.h

Unfortunatly since this is in a string this doesn't get caught by the
compiler. Anyways I'm attaching a fixed patch for you.


Comment 7 Hans de Goede 2005-03-10 17:31:00 UTC
Created attachment 111862 [details]
improved (bugfree/tested) patch

Hmm,

Something still isn't ok, shift + cursorkeys left/right doesn't work as one
would expect. This patch is an improvement over the last one but I might need
todo a third revision.

Comment 8 Hans de Goede 2005-03-10 20:16:16 UTC
I've pinned down the shift cursor left/right strangeness, these are 
caught by the konsole ui-widgets for changing tabs and thus never 
reach the terminal emulation object.

For now please apply the fixed patch, I will probably be back with a 
cleaned up version, but no functional changes. I'm planning on 
removing all the shift cursor left/right bindings since these will
never be used.

Currently I'm trying to get contact with upstream and discuss this 
with them since they've added some specific emulation bindings for 
shift cursor left/right which is strange since these never reach the 
emulation object. See:
http://bugs.kde.org/show_bug.cgi?id=92749

Comment 9 Than Ngo 2005-03-14 15:51:06 UTC
it's included in kdebase-3.4.0-0.rc1.5. thanks

Comment 10 Than Ngo 2005-03-14 16:11:52 UTC
sorry, i mean kdebase-3.4.0-0.rc1.6

Comment 11 Hans de Goede 2005-03-24 20:51:55 UTC
Created attachment 112337 [details]
cleaned up patch

After discussion with upstream all the bogus(unused) shifted cursorkey bindings
have been removed, resulting in a much cleaned up patch.

This is the last one (I promise) and as such has been submitted upstream for
inclusion, which will hopefully hapen soon.

Comment 12 Than Ngo 2005-04-06 14:37:47 UTC
it's commited in our CVS. The kdebase-3.4.0-3 will include this fix. thanks

Comment 13 Hans de Goede 2005-04-19 07:33:20 UTC
Created attachment 113354 [details]
Patch fixing the described inconcistencies

I know I promised the last version was final, but I'm afraid this needs one
more itteration.

The previous versions of this patch changed the character send by the backspace
key from ASCII-DEL (\177) to CTRL-H (^H) to match the real xterm and terminfo
as distributed both upstream and by Fedora/RH. However as resolution to bug
142659 it has been decided that backspace for terminals setting TERM to xterm
should send ASCII-DEL. Patches for terminfo (bug 142659) and xterm (bug 128138)
doing this are pending.

This really really _really_ last itteration of this patch thus removes the part
which changes backspace from ASCII-DEL to CTRL-H . Please apply.

Comment 14 Than Ngo 2005-04-19 10:58:46 UTC
It's now included in kdebase-3.4.0-6. Many thanks for your patch file


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