From 3ade5f0011b145e2a2fa9713cba756b89569f6ae Mon Sep 17 00:00:00 2001 From: Brandon Benvie Date: Sat, 21 Jan 2012 12:04:21 -0500 Subject: [PATCH] Windows: Add support for interpreting axiterm-style colors. --- src/win/tty.c | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/src/win/tty.c b/src/win/tty.c index 88c68954c9..e61fc7e28e 100644 --- a/src/win/tty.c +++ b/src/win/tty.c @@ -1069,13 +1069,26 @@ static int uv_tty_set_style(uv_tty_t* handle, DWORD* error) { bg_bright = 0; } else if (arg == 1) { - /* Bright */ + /* Foreground bright on */ fg_bright = 1; + } else if (arg == 2) { + /* Both bright off */ + fg_bright = 0; + bg_bright = 0; + + } else if (arg == 5) { + /* Background bright on */ + bg_bright = 1; + } else if (arg == 21 || arg == 22) { - /* Bright off. */ + /* Foreground bright off */ fg_bright = 0; + } else if (arg == 25) { + /* Background bright off */ + bg_bright = 0; + } else if (arg >= 30 && arg <= 37) { /* Set foreground color */ fg_color = arg - 30; @@ -1091,6 +1104,17 @@ static int uv_tty_set_style(uv_tty_t* handle, DWORD* error) { } else if (arg == 49) { /* Default background color */ bg_color = 0; + + } else if (arg >= 90 && arg <= 97) { + /* Set bold foreground color */ + fg_bright = 1; + fg_color = arg - 90; + + } else if (arg >= 100 && arg <= 107) { + /* Set bold background color */ + bg_bright = 1; + bg_color = arg - 100; + } }