Revision: 2668
          http://tmux.svn.sourceforge.net/tmux/?rev=2668&view=rev
Author:   tcunha
Date:     2012-01-21 19:33:45 +0000 (Sat, 21 Jan 2012)
Log Message:
-----------
Sync OpenBSD patchset 1006:

Add strings to allow the aixterm bright colours to be used when
configuring colours, requested by Elliott Cable a few months ago.

Modified Paths:
--------------
    trunk/colour.c
    trunk/input.c
    trunk/tmux.1
    trunk/tty.c

Modified: trunk/colour.c
===================================================================
--- trunk/colour.c      2012-01-21 19:32:36 UTC (rev 2667)
+++ trunk/colour.c      2012-01-21 19:33:45 UTC (rev 2668)
@@ -170,6 +170,22 @@
                return ("white");
        case 8:
                return ("default");
+       case 90:
+               return ("brightblack");
+       case 91:
+               return ("brightred");
+       case 92:
+               return ("brightgreen");
+       case 93:
+               return ("brightyellow");
+       case 94:
+               return ("brightblue");
+       case 95:
+               return ("brightmagenta");
+       case 96:
+               return ("brightcyan");
+       case 97:
+               return ("brightwhite");
        }
        return (NULL);
 }
@@ -219,6 +235,30 @@
                return (7);
        if (strcasecmp(s, "default") == 0 || (s[0] == '8' && s[1] == '\0'))
                return (8);
+       if (strcasecmp(s, "brightblack") == 0 ||
+           (s[0] == '9' && s[1] == '0' && s[1] == '\0'))
+               return (90);
+       if (strcasecmp(s, "brightred") == 0 ||
+           (s[0] == '9' && s[1] == '1' && s[1] == '\0'))
+               return (91);
+       if (strcasecmp(s, "brightgreen") == 0 ||
+           (s[0] == '9' && s[1] == '2' && s[1] == '\0'))
+               return (92);
+       if (strcasecmp(s, "brightyellow") == 0 ||
+           (s[0] == '9' && s[1] == '3' && s[1] == '\0'))
+               return (93);
+       if (strcasecmp(s, "brightblue") == 0 ||
+           (s[0] == '9' && s[1] == '4' && s[1] == '\0'))
+               return (94);
+       if (strcasecmp(s, "brightmagenta") == 0 ||
+           (s[0] == '9' && s[1] == '5' && s[1] == '\0'))
+               return (95);
+       if (strcasecmp(s, "brightcyan") == 0 ||
+           (s[0] == '9' && s[1] == '6' && s[1] == '\0'))
+               return (96);
+       if (strcasecmp(s, "brightwhite") == 0 ||
+           (s[0] == '9' && s[1] == '7' && s[1] == '\0'))
+               return (97);
        return (-1);
 }
 

Modified: trunk/input.c
===================================================================
--- trunk/input.c       2012-01-21 19:32:36 UTC (rev 2667)
+++ trunk/input.c       2012-01-21 19:33:45 UTC (rev 2668)
@@ -1436,7 +1436,7 @@
                case 106:
                case 107:
                        gc->flags &= ~GRID_FLAG_BG256;
-                       gc->bg = n;
+                       gc->bg = n - 10;
                        break;
                }
        }

Modified: trunk/tmux.1
===================================================================
--- trunk/tmux.1        2012-01-21 19:32:36 UTC (rev 2667)
+++ trunk/tmux.1        2012-01-21 19:33:45 UTC (rev 2668)
@@ -1980,6 +1980,10 @@
 .Ic magenta ,
 .Ic cyan ,
 .Ic white ,
+aixterm bright variants (if supported:
+.Ic brightred ,
+.Ic brightgreen ,
+and so on),
 .Ic colour0
 to
 .Ic colour255

Modified: trunk/tty.c
===================================================================
--- trunk/tty.c 2012-01-21 19:32:36 UTC (rev 2667)
+++ trunk/tty.c 2012-01-21 19:33:45 UTC (rev 2668)
@@ -1440,7 +1440,7 @@
 
        /* Is this an aixterm colour? */
        colours = tty_term_number(tty->term, TTYC_COLORS);
-       if (gc->bg >= 100 && gc->bg <= 107 && colours < 16) {
+       if (gc->bg >= 90 && gc->bg <= 97 && colours < 16) {
                gc->bg -= 90;
                gc->attr |= GRID_ATTR_BRIGHT;
        }
@@ -1500,14 +1500,14 @@
        }
 
        /* Is this an aixterm bright colour? */
-       if (bg >= 100 && bg <= 107) {
+       if (bg >= 90 && bg <= 97) {
                /* 16 colour terminals or above only. */
                if (tty_term_number(tty->term, TTYC_COLORS) >= 16) {
-                       xsnprintf(s, sizeof s, "\033[%dm", bg);
+                       xsnprintf(s, sizeof s, "\033[%dm", bg + 10);
                        tty_puts(tty, s);
                        goto save_bg;
                }
-               bg -= 100;
+               bg -= 90;
                /* no such thing as a bold background */
        }
 

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
tmux-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tmux-cvs

Reply via email to