Version: (using KDE 4.1.0) Installed from: Compiled From Sources OS: Linux from KDE3.5.6 the konsole adds xterm256 support, however, it is using a different palette from the stardard xterm. In my opinion this is a bug rather than a feature. Rationale 1: konsole report itself as TERM=xterm, so the palette should behave like the standard xterm. Rationale 2: the xterm256 color palette actually represent more natural colors in visible color space. Rationale 3: xterm, gnome-terminal, xfce4-terminal and putty all use the same palette, konsole seems to be the only exception. I had done the patch for both KDE3 and KDE4, the patched konsole works great since the xterm256 is much more useful with the standard xterm palette.
my patch for KDE3.5.6: diff -c TECommon.h.orig TECommon.h *** TECommon.h.orig 2008-08-13 11:18:32.000000000 +0800 --- TECommon.h 2008-08-13 11:18:14.000000000 +0800 *************** *** 153,161 **** if (u < 8) return base[u+2+BASE_COLORS].color; u -= 8; // 16..231: 6x6x6 rgb color cube ! if (u < 216) return QColor(255*((u/36)%6)/5, ! 255*((u/ 6)%6)/5, ! 255*((u/ 1)%6)/5); u -= 216; // 232..255: gray, leaving out black and white int gray = u*10+8; return QColor(gray,gray,gray); --- 153,161 ---- if (u < 8) return base[u+2+BASE_COLORS].color; u -= 8; // 16..231: 6x6x6 rgb color cube ! if (u < 216) return QColor(((u/36)%6) ? (40*((u/36)%6)+55) : 0, ! ((u/ 6)%6) ? (40*((u/ 6)%6)+55) : 0, ! ((u/ 1)%6) ? (40*((u/ 1)%6)+55) : 0); u -= 216; // 232..255: gray, leaving out black and white int gray = u*10+8; return QColor(gray,gray,gray);
my patch for KDE 4.1.0: diff -c CharacterColor.h.orig CharacterColor.h *** CharacterColor.h.orig 2008-08-13 11:25:19.000000000 +0800 --- CharacterColor.h 2008-08-13 11:26:24.000000000 +0800 *************** *** 244,253 **** if (u < 8) return base[u+2+BASE_COLORS].color; u -= 8; // 16..231: 6x6x6 rgb color cube ! if (u < 216) return QColor(255*((u/36)%6)/5, ! 255*((u/ 6)%6)/5, ! 255*((u/ 1)%6)/5); u -= 216; ! // 232..255: gray, leaving out black and white int gray = u*10+8; return QColor(gray,gray,gray); } --- 244,253 ---- if (u < 8) return base[u+2+BASE_COLORS].color; u -= 8; // 16..231: 6x6x6 rgb color cube ! if (u < 216) return QColor(((u/36)%6) ? (40*((u/36)%6)+55) : 0, ! ((u/ 6)%6) ? (40*((u/ 6)%6)+55) : 0, ! ((u/ 1)%6) ? (40*((u/ 1)%6)+55) : 0); u -= 216; ! // 232..255: gray, leaving out black and white int gray = u*10+8; return QColor(gray,gray,gray); }
Hi Pan, Thank-you for the patch. I'm sorry I haven't reviewed it yet. Please keep pinging me if I forget.
What is the preferred format of patch here? I'll test my patch in the newest version of KDE and (if necessary) upload patches as attachment here. I hope the patch could get into KDE 4.2, will it get reviewed soon?
> What is the preferred format of patch here? Unified diff (as in 'diff -u') please.
Created attachment 28560 [details] tested patch for konsole in kde 3.5.10
Created attachment 28561 [details] patch for konsole in kde 4.1.2, also works for 4.2 series
Created attachment 28562 [details] use this to check the 256color output vs other terminal I had tested the patch and generated the patch in diff -u format. This python program can help for test, the output should pixel-to-pixel match the output from terminals others than konsole.
@Konsole Developers: any reaction?
@Nick Shaforostoff Robert Knight saids that "Keep pinging me", so let's just keep pinging him. If you want the patch just use mine, I have be using my patch for more than 6 months and it works great so far. My patch works for the 3.5.x, 4.1.x and 4.2 snapshot.
SVN commit 909719 by knight: Use the same palette as xterm for 256-color mode. Patch by pan.shizhu@gmail.com BUG: 169013 M +3 -3 CharacterColor.h WebSVN link: http://websvn.kde.org/?view=rev&revision=909719
Thanks pan - sorry for the delay.
SVN commit 909720 by knight: Backport. Use the same palette as xterm for 256-color mode. Patch by pan.shizhu@gmail.com CCBUG: 169013 M +3 -3 CharacterColor.h WebSVN link: http://websvn.kde.org/?view=rev&revision=909720