aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorBruce Evans <bde@FreeBSD.org>2017-03-27 10:48:28 +0000
committerBruce Evans <bde@FreeBSD.org>2017-03-27 10:48:28 +0000
commit1370fa3380676f7d545aa221637c15abb3398058 (patch)
tree2a8c6c10f6ead61c631ccdecabb8abf3da91bd3f /sys
parent759c8caa5a6889ee891b1072f9dd4ada7cccf913 (diff)
Notes
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/subr_terminal.c13
-rw-r--r--sys/teken/teken.c16
2 files changed, 19 insertions, 10 deletions
diff --git a/sys/kern/subr_terminal.c b/sys/kern/subr_terminal.c
index 9f7f95856b7a..484408e980a3 100644
--- a/sys/kern/subr_terminal.c
+++ b/sys/kern/subr_terminal.c
@@ -146,9 +146,18 @@ static const teken_attr_t default_message = {
TCOLOR_BG(_c & 7) | ((_c & 8) << 20); \
})
+#define TCOLOR_256TO16(color) __extension__ ({ \
+ teken_color_t _c; \
+ \
+ _c = (color); \
+ if (_c >= 16) \
+ _c = teken_256to16(_c); \
+ _c; \
+})
+
#define TCHAR_CREATE(c, a) ((c) | TFORMAT((a)->ta_format) | \
- TCOLOR_FG_FUDGED(teken_256to16((a)->ta_fgcolor)) | \
- TCOLOR_BG_FUDGED(teken_256to16((a)->ta_bgcolor)))
+ TCOLOR_FG_FUDGED(TCOLOR_256TO16((a)->ta_fgcolor)) | \
+ TCOLOR_BG_FUDGED(TCOLOR_256TO16((a)->ta_bgcolor)))
static void
terminal_init(struct terminal *tm)
diff --git a/sys/teken/teken.c b/sys/teken/teken.c
index 6a9842d53848..5a8177762be8 100644
--- a/sys/teken/teken.c
+++ b/sys/teken/teken.c
@@ -491,11 +491,11 @@ teken_state_numbers(teken_t *t, teken_char_t c)
* be twice as large as green in (0, 1, 2).
*/
static const teken_color_t teken_256to8tab[] = {
- /* xterm-16+ 8 dark colors: */
- 0, r, g, y, b, m, c, w,
+ /* xterm normal colors: */
+ k, r, g, y, b, m, c, w,
- /* xterm-16+ 8 light colors: */
- 0, R, G, Y, B, M, C, W,
+ /* xterm bright colors: */
+ k, r, g, y, b, m, c, w,
/* Red0 submap. */
k, b, b, b, b, b,
@@ -559,11 +559,11 @@ static const teken_color_t teken_256to8tab[] = {
* used for different fine tuning of the tables.
*/
static const teken_color_t teken_256to16tab[] = {
- /* xterm-16+ 8 dark colors: */
- 0, r, g, y, b, m, c, w,
+ /* xterm normal colors: */
+ k, r, g, y, b, m, c, w,
- /* xterm-16+ 8 light colors: */
- 0, R, G, Y, B, M, C, W,
+ /* xterm bright colors: */
+ K, R, G, Y, B, M, C, W,
/* Red0 submap. */
k, b, b, b, b, b,