From c6c3e8d906ba7953916106bab2ad6cc829c811cf Mon Sep 17 00:00:00 2001 From: Jelmer Snoeck Date: Mon, 2 Oct 2017 04:59:06 +0100 Subject: [PATCH] Add support for bold text. (#106) Currently, bold text isn't supported. This adds the support for bold text formatting. --- ansi_windows.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ansi_windows.go b/ansi_windows.go index da106b5..63b908c 100644 --- a/ansi_windows.go +++ b/ansi_windows.go @@ -25,6 +25,7 @@ const ( COLOR_BINTENSITY = 0x0080 COMMON_LVB_UNDERSCORE = 0x8000 + COMMON_LVB_BOLD = 0x0007 ) var ColorTableFg = []word{ @@ -163,6 +164,8 @@ func (a *ANSIWriterCtx) ioloopEscSeq(w *bufio.Writer, r rune, argptr *[]string) color |= ColorTableBg[c-40] } else if c == 4 { color |= COMMON_LVB_UNDERSCORE | ColorTableFg[7] + } else if c == 1 { + color |= COMMON_LVB_BOLD | COLOR_FINTENSITY } else { // unknown code treat as reset color = ColorTableFg[7] }