Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Windows: Add support for interpreting axiterm-style colors.

  • Loading branch information...
Brandon Benvie authored and piscisaureus committed Jan 21, 2012
1 parent 24e6c7e commit 3ade5f0011b145e2a2fa9713cba756b89569f6ae
Showing with 26 additions and 2 deletions.
  1. +26 −2 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;

}
}

0 comments on commit 3ade5f0

Please sign in to comment.
You can’t perform that action at this time.