Skip to content

Commit

Permalink
Windows: Add support for interpreting axiterm-style colors.
Browse files Browse the repository at this point in the history
  • Loading branch information
Brandon Benvie authored and piscisaureus committed Jan 23, 2012
1 parent 24e6c7e commit 3ade5f0
Showing 1 changed file with 26 additions and 2 deletions.
28 changes: 26 additions & 2 deletions src/win/tty.c
Expand Up @@ -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;
Expand All @@ -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;

}
}

Expand Down

0 comments on commit 3ade5f0

Please sign in to comment.