Hi,

attached is a patch to set the colors with ESC sequences. What you mean is
something like mouse reporting / special graphics mode query, right?
Are there other terminal emulators doing that? Shouldn't be hard to
implement.

On Tue, 25 Jul 2000, Johannes Zellner wrote:

> is it possible to query (e.g. from a program) the colors of rxvt ?
> (bg and fg would be sufficient)


  cu.
    :
    Christian
--- rxvt-2.7.3-orig/README.set-color    Thu Apr 27 23:21:45 2000
+++ rxvt-2.7.3/README.set-color Thu Apr 27 23:19:28 2000
@@ -0,0 +1,44 @@
+Color extensions of XTerm escape sequences: ESC ] Ps;Pt BEL
+Note: Ps values are experimental -- any input welcome
+
+Author Christian W. Zuckschwerdt <[EMAIL PROTECTED]>  2000-04-27
+
+In addition to the Ps values 39 and 49 there are some other
+values to change the actual rxvt color scheme.
+
+ESC ] Ps;Pt BEL
+
+       Ps = 39         Change default foreground colour to Pt
+       Ps = 49         Change default background colour to Pt
+
+       Ps = 60         Change former 'black' color
+       Ps = 61         Change former 'red' color  
+       Ps = 62         Change former 'green' color
+       Ps = 63         Change former 'yellow' color
+       Ps = 64         Change former 'blue' color  
+       Ps = 65         Change former 'magenta' color
+       Ps = 66         Change former 'cyan' color   
+       Ps = 67         Change former 'white' color  
+       Ps = 68         Change former 'bright black' color
+       Ps = 69         Change former 'bright red' color
+       Ps = 70         Change former 'bright green' color
+       Ps = 71         Change former 'bright yellow' color 
+       Ps = 72         Change former 'bright blue' color
+       Ps = 73         Change former 'bright magenta' color
+       Ps = 74         Change former 'bright cyan' color
+       Ps = 75         Change former 'bright white' color
+
+       Ps = 80         Change actual 'Cursor' color
+       Ps = 81         Change actual 'Cursor2' color
+       Ps = 82         Change actual 'Pointer' color
+       Ps = 83         Change actual 'Border' color 
+       Ps = 84         Change actual 'Bold' color   
+       Ps = 85         Change actual 'Underline' color
+       Ps = 86         Change actual 'Scroll' color   
+       Ps = 87         Change actual 'Trough' color   
+       Ps = 88         Change actual 'Top Shadow' color
+       Ps = 89         Change actual 'Bottom Shadow' color
+
+
+More documentation on request, if anyone actually cares.
+
--- rxvt-2.7.3-orig/src/command.c       Fri Jan 14 06:05:03 2000
+++ rxvt-2.7.3/src/command.c    Thu Apr 27 22:59:18 2000
@@ -2027,6 +2027,66 @@
     case XTerm_restoreBG:
        set_window_color(Color_bg, str);
        break;
+    case XTerm_Color_0:
+    case XTerm_Color_1:
+    case XTerm_Color_2:
+    case XTerm_Color_3:
+    case XTerm_Color_4:
+    case XTerm_Color_5:
+    case XTerm_Color_6:
+    case XTerm_Color_7:
+       set_window_color(op-XTerm_Color_0+minCOLOR, str);
+       break;
+#ifndef NO_BRIGHTCOLOR
+    case XTerm_Color_8:
+    case XTerm_Color_9:
+    case XTerm_Color_10:
+    case XTerm_Color_11:
+    case XTerm_Color_12:
+    case XTerm_Color_13:
+    case XTerm_Color_14:
+    case XTerm_Color_15:
+       set_window_color(op-XTerm_Color_8+minBrightCOLOR, str);
+       break;
+#endif
+#ifndef NO_CURSORCOLOR
+    case XTerm_Color_cursor:
+       set_window_color(Color_cursor, str);
+       break;
+    case XTerm_Color_cursor2:
+       set_window_color(Color_cursor2, str);
+       break;
+#endif
+    case XTerm_Color_pointer:
+       set_window_color(Color_pointer, str);
+       break;
+    case XTerm_Color_border:
+       set_window_color(Color_border, str);
+       break;
+#ifndef NO_BOLDUNDERLINE
+    case XTerm_Color_BD:
+       set_window_color(Color_BD, str);
+       break;
+    case XTerm_Color_UL:
+       set_window_color(Color_UL, str);
+       break;
+#endif
+#ifdef KEEP_SCROLLCOLOR
+    case XTerm_Color_scroll:
+       set_window_color(Color_scroll, str);
+       break;
+    case XTerm_Color_trough:
+       set_window_color(Color_trough, str);
+       break;
+#endif
+#ifdef KEEP_SCROLLCOLOR
+    case XTerm_Color_topShadow:
+       set_window_color(Color_topShadow, str);
+       break;
+    case XTerm_Color_bottomShadow:
+       set_window_color(Color_bottomShadow, str);
+       break;
+#endif
     case XTerm_logfile:
        break;
     case XTerm_font:
--- rxvt-2.7.3-orig/src/rxvt.h  Sun Feb 27 05:57:52 2000
+++ rxvt-2.7.3/src/rxvt.h       Thu Apr 27 23:21:26 2000
@@ -475,6 +475,39 @@
 #define restoreFG              39      /* restore default fg color */
 #define restoreBG              49      /* restore default bg color */
 
+/*
+ * color extensions of XTerm escape sequences: ESC ] Ps;Pt BEL
+ * Ps values are experimental -- any input welcome
+ * Christian W. Zuckschwerdt <[EMAIL PROTECTED]>  2000-04-27
+ */
+#define XTerm_Color_0          60      /* change former 'black' color */
+#define XTerm_Color_1          61      /* change former 'red' color */
+#define XTerm_Color_2          62      /* change former 'green' color */
+#define XTerm_Color_3          63      /* change former 'yellow' color */
+#define XTerm_Color_4          64      /* change former 'blue' color */
+#define XTerm_Color_5          65      /* change former 'magenta' color */
+#define XTerm_Color_6          66      /* change former 'cyan' color */
+#define XTerm_Color_7          67      /* change former 'white' color */
+#define XTerm_Color_8          68      /* change former 'bright black' color */
+#define XTerm_Color_9          69      /* change former 'bright red' color */
+#define XTerm_Color_10         70      /* change former 'bright green' color */
+#define XTerm_Color_11         71      /* change former 'bright yellow' color */
+#define XTerm_Color_12         72      /* change former 'bright blue' color */
+#define XTerm_Color_13         73      /* change former 'bright magenta' color */
+#define XTerm_Color_14         74      /* change former 'bright cyan' color */
+#define XTerm_Color_15         75      /* change former 'bright white' color */
+
+#define XTerm_Color_cursor     80      /* change actual 'Cursor' color */
+#define XTerm_Color_cursor2    81      /* change actual 'Cursor2' color */
+#define XTerm_Color_pointer    82      /* change actual 'Pointer' color */
+#define XTerm_Color_border     83      /* change actual 'Border' color */
+#define XTerm_Color_BD         84      /* change actual 'Bold' color */
+#define XTerm_Color_UL         85      /* change actual 'Underline' color */
+#define XTerm_Color_scroll     86      /* change actual 'Scroll' color */
+#define XTerm_Color_trough     87      /* change actual 'Trough' color */
+#define XTerm_Color_topShadow  88      /* change actual 'Top Shadow' color */
+#define XTerm_Color_bottomShadow 89    /* change actual 'Bottom Shadow' color */
+
 /* Words starting with `Color_' are colours.  Others are counts */
 
 enum colour_list {
--- rxvt-2.7.3-orig/src/main.c  Sun Feb 27 05:57:52 2000
+++ rxvt-2.7.3/src/main.c       Mon May  1 22:23:41 2000
@@ -785,7 +785,10 @@
        XRecolorCursor(Xdisplay, TermWin_cursor, &fg, &bg);
     }
 /* the only reasonable way to enforce a clean update */
-    scr_poweron();
+/*    scr_poweron(); */
+/* a refresh should suffice -- but someone please let me known: */
+/* FAST_REFRESH, SLOW_REFRESH or SMOOTH_REFRESH ??? */
+    scr_refresh(SLOW_REFRESH);
 }
 #else
 # define set_window_color(idx,color)   ((void)0)

Reply via email to