| Summary: | xterm256 color palette not compatible with standard xterm | ||
|---|---|---|---|
| Product: | [Applications] konsole | Reporter: | pan shi zhu <pan.shizhu> |
| Component: | general | Assignee: | Konsole Bugs <konsole-bugs-null> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | robertknight, shafff |
| Priority: | NOR | ||
| Version First Reported In: | unspecified | ||
| Target Milestone: | --- | ||
| Platform: | Compiled Sources | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
| Attachments: |
tested patch for konsole in kde 3.5.10
patch for konsole in kde 4.1.2, also works for 4.2 series use this to check the 256color output vs other terminal |
||
|
Description
pan shi zhu
2008-08-13 05:16:46 UTC
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 |