Bug 138191 - Incompatibilities between konsole and real xterm [patch]
Incompatibilities between konsole and real xterm [patch]
Product: Fedora
Classification: Fedora
Component: kdebase (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Ngo Than
Depends On:
  Show dependency treegraph
Reported: 2004-11-05 09:52 EST 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: 2005-03-10 05:38:30 EST
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 tthe described inconcistencies (16.46 KB, patch)
2005-02-25 10:07 EST, Hans de Goede
no flags Details | Diff
Same patch but this time against 3.4.0rc1 (20.07 KB, patch)
2005-03-09 11:02 EST, Hans de Goede
no flags Details | Diff
improved (bugfree/tested) patch (20.07 KB, patch)
2005-03-10 12:31 EST, Hans de Goede
no flags Details | Diff
cleaned up patch (17.84 KB, patch)
2005-03-24 15:51 EST, Hans de Goede
no flags Details | Diff
Patch fixing the described inconcistencies (17.23 KB, patch)
2005-04-19 03:33 EDT, Hans de Goede
no flags Details | Diff

  None (edit)
Description Hans de Goede 2004-11-05 09:52:24 EST
I'm also reporting this here, because the response to similar bug
reports upstream have been lacking. This is reported upstream under:

For the lack of progress with simular bugs upstream see:

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 
-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 Ngo Than 2004-11-05 10:06:24 EST
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 10:06:08 EST
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

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 
   -a setErase member to the TEPty class
   -a getErase member to the TEmuVt102 class and to the TEmulator
   -added code to session.cpp which ties these 2 together

That's all folks, please apply!
Comment 3 Hans de Goede 2005-02-25 10:07:00 EST
Created attachment 111423 [details]
Patch fixing tthe described inconcistencies
Comment 4 Hans de Goede 2005-03-09 11:02:38 EST
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 :)

Comment 5 Ngo Than 2005-03-10 05:38:30 EST
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 12:24:54 EST

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 12:31:00 EST
Created attachment 111862 [details]
improved (bugfree/tested) patch


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 15:16:16 EST
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:
Comment 9 Ngo Than 2005-03-14 10:51:06 EST
it's included in kdebase-3.4.0-0.rc1.5. thanks
Comment 10 Ngo Than 2005-03-14 11:11:52 EST
sorry, i mean kdebase-3.4.0-0.rc1.6
Comment 11 Hans de Goede 2005-03-24 15:51:55 EST
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 Ngo Than 2005-04-06 10:37:47 EDT
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 03:33:20 EDT
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 Ngo Than 2005-04-19 06:58:46 EDT
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.