From bfbebf7679ef228a1f12391e64f74ac91bad5c91 Mon Sep 17 00:00:00 2001 From: nicm Date: Thu, 12 Jan 2023 12:28:08 +0000 Subject: [PATCH] Add aixterm bright colour sequences (SGR 90-97 and 100-107). From Crystal Kolipe kolipe.c at exoticsilicon dot com. ok miod --- sys/dev/rasops/rasops.c | 5 +++-- sys/dev/wscons/wsemul_vt100_subr.c | 14 +++++++++++++- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/sys/dev/rasops/rasops.c b/sys/dev/rasops/rasops.c index 3de0d00df1a..996891daadb 100644 --- a/sys/dev/rasops/rasops.c +++ b/sys/dev/rasops/rasops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rasops.c,v 1.67 2023/01/11 12:47:04 nicm Exp $ */ +/* $OpenBSD: rasops.c,v 1.68 2023/01/12 12:28:08 nicm Exp $ */ /* $NetBSD: rasops.c,v 1.35 2001/02/02 06:01:01 marcus Exp $ */ /*- @@ -557,7 +557,8 @@ rasops_pack_cattr(void *cookie, int fg, int bg, int flg, uint32_t *attr) bg = swap; } - if ((flg & WSATTR_HILIT) != 0) + /* Bold is only supported for ANSI colors 0 - 7. */ + if ((flg & WSATTR_HILIT) != 0 && fg < 8) fg += 8; flg = ((flg & WSATTR_UNDERLINE) ? 1 : 0); diff --git a/sys/dev/wscons/wsemul_vt100_subr.c b/sys/dev/wscons/wsemul_vt100_subr.c index e97d65bbb8e..b68d94b272c 100644 --- a/sys/dev/wscons/wsemul_vt100_subr.c +++ b/sys/dev/wscons/wsemul_vt100_subr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wsemul_vt100_subr.c,v 1.26 2023/01/12 12:23:40 nicm Exp $ */ +/* $OpenBSD: wsemul_vt100_subr.c,v 1.27 2023/01/12 12:28:08 nicm Exp $ */ /* $NetBSD: wsemul_vt100_subr.c,v 1.7 2000/04/28 21:56:16 mycroft Exp $ */ /* @@ -607,6 +607,18 @@ wsemul_vt100_handle_csi(struct wsemul_vt100_emuldata *edp, if (fgcol == WSCOL_WHITE) flags &= ~WSATTR_WSCOLORS; break; + case 90: case 91: case 92: case 93: + case 94: case 95: case 96: case 97: + /* bright foreground color */ + flags |= WSATTR_WSCOLORS; + fgcol = ARG(n) - 82; + break; + case 100: case 101: case 102: case 103: + case 104: case 105: case 106: case 107: + /* bright background color */ + flags |= WSATTR_WSCOLORS; + bgcol = ARG(n) - 92; + break; default: #ifdef VT100_PRINTUNKNOWN printf("CSI%dm unknown\n", ARG(n)); -- 2.20.1