*** empty log message ***
authorroot <root>
Sat, 31 Dec 2005 16:06:48 +0000 (16:06 +0000)
committerroot <root>
Sat, 31 Dec 2005 16:06:48 +0000 (16:06 +0000)
Changes
doc/rxvt.1.pod
src/ptytty.C
src/rxvt.h
src/rxvtlib.h.in
src/xdefaults.C

diff --git a/Changes b/Changes
index 088da1afe96286a46c66518ce348c9e415bb21f3..0875f3931ac8716f2906e53da0566309cf7368cb 100644 (file)
--- a/Changes
+++ b/Changes
@@ -18,6 +18,9 @@ WISH: just for fun, do shade and tint with XRender.
           most BSDs), privileges weren't dropped before opening the pty,
           resulting in wrong permissions on the pseudo terminal.
           Reported and fixed by Ryan Beasley.
+        - implemented intensityStyles option which enables/disables bold/blink
+          selecting high intensity foreground/background colours, suggested by
+          Chuck Blake.
        - replaced callback.h by a fixed version from gvpe that correctly
           returns the callback result (affects new -pty-fd semantics in urxvtc
           on a few architectures). Reported by darix.
index ba8df6963a99d5da39fdea803d0608d587c4de0f..15eeeb87a732481aed460144940991a36de20599 100644 (file)
@@ -204,6 +204,12 @@ be printed. See resource B<italicFont> for details.
 Compile font-styles: The bold italic font list to use when bold characters are to
 be printed. See resource B<boldItalicFont> for details.
 
+=item B<-is>|B<+is>
+
+Compile font-styles: Bold/Italic font styles imply high intensity
+foreground/background (default). See resource B<intensityStyles> for
+details.
+
 =item B<-name> I<name>
 
 Specify the application name under which resources are to be obtained,
@@ -689,6 +695,14 @@ not possible, replacement fonts of the desired shape will be tried.
 If set, but empty, then this specific style is disabled and the normal
 text font will being used for the given style.
 
+=item B<intensityStyles:> I<boolean>
+
+When font styles are not enabled, or this option is enabled (B<True>,
+option B<-is>, the default), bold and italic font styles imply high
+intensity foreground/backround colours. Disabling this option (B<False>,
+option B<+is>) disables this behaviour, the high intensity colours are not
+reachable.
+
 =item B<selectstyle:> I<mode>
 
 Set mouse selection style to B<old> which is 2.20, B<oldword> which is
index 3cf50424f51651c2770e112e5b0eefdb91e8c6f7..6bd703a9dcdc49c8717e220fea0e7ea028c43fd8 100644 (file)
@@ -76,9 +76,13 @@ get_pty (int *fd_tty, char **ttydev)
   int pfd;
 
 #ifdef PTYS_ARE_OPENPTY
-  char tty_name[sizeof "/dev/pts/????\0"];
+  char tty_name[sizeof "/dev/pts/?????\0"];
 
-  if (openpty (&pfd, fd_tty, tty_name, NULL, NULL) != -1)
+  rxvt_privileges (RESTORE);
+  int res = openpty (&pfd, fd_tty, tty_name, NULL, NULL);
+  rxvt_privileges (IGNORE);
+
+  if (res != -1)
     {
       *ttydev = strdup (tty_name);
       return pfd;
index 89c2a1b46481b7b07e39cd41e039cb917292ea8b..b2a7b44b6687cdd2168b8432f4edd9f75ab3432e 100644 (file)
@@ -638,6 +638,7 @@ enum {
   Rs_borderLess,
   Rs_lineSpace,
   Rs_cursorUnderline,
+  Rs_intensityStyles,
 #endif
 #if CURSOR_BLINK
   Rs_cursorBlink,
@@ -829,18 +830,18 @@ enum {
 #define GET_BASEFG(x)           (((x) & RS_fgMask))
 #define GET_BASEBG(x)           (((x) & RS_bgMask)>>Color_Bits)
 #ifndef NO_BRIGHTCOLOR
-# define GET_FGCOLOR(x)                                          \
-    ((((x) & RS_Bold) == 0                                       \
-      || GET_BASEFG (x) < minCOLOR                               \
-      || GET_BASEFG (x) >= minBrightCOLOR)                       \
-     ? GET_BASEFG (x)                                            \
-     : (GET_BASEFG (x) + (minBrightCOLOR - minCOLOR)))
-# define GET_BGCOLOR(x)                                          \
-    ((((x) & RS_Blink) == 0                                      \
-      || GET_BASEBG (x) < minCOLOR                               \
-      || GET_BASEBG (x) >= minBrightCOLOR)                       \
-     ? GET_BASEBG (x)                                            \
-     : (GET_BASEBG (x) + (minBrightCOLOR - minCOLOR)))
+# define GET_FGCOLOR(x) (                                        \
+     !((x) & RS_Bold)                                            \
+     || (ENABLE_STYLES && !(options & Opt_intensityStyles))      \
+     || !IN_RANGE_INC (GET_BASEFG (x), minCOLOR, minBrightCOLOR) \
+       ? GET_BASEFG (x)                                          \
+       : (GET_BASEFG (x) + (minBrightCOLOR - minCOLOR)))
+# define GET_BGCOLOR(x) (                                        \
+     !((x) & RS_Blink)                                           \
+     || (ENABLE_STYLES && !(options & Opt_intensityStyles))      \
+     || !IN_RANGE_INC (GET_BASEBG (x), minCOLOR, minBrightCOLOR) \
+       ? GET_BASEBG (x)                                          \
+       : (GET_BASEBG (x) + (minBrightCOLOR - minCOLOR)))
 #else
 # define GET_FGCOLOR(x)         GET_BASEFG(x)
 # define GET_BGCOLOR(x)         GET_BASEBG(x)
index dbc2f2f186321448fd04a56b92a75e64bce80302..d395b59de6c8b28f3ada049fceaab6b49d5205cc 100644 (file)
@@ -261,13 +261,18 @@ typedef struct {
 # define Opt_borderLess                 0
 # define Opt_hold               0
 #endif
+#if ENABLE_STYLES
+# define Opt_intensityStyles    (1UL<<27) // font styles imply intensity
+#else
+# define Opt_intensityStyles    0
+#endif
 /* place holder used for parsing command-line options */
 #define Opt_Reverse              (1UL<<30)
 #define Opt_Boolean              (1UL<<31)
 
 #define DEFAULT_OPTIONS          (Opt_scrollBar | Opt_scrollTtyOutput \
                                   | Opt_jumpScroll | Opt_secondaryScreen \
-                                  | Opt_pastableTabs)
+                                  | Opt_pastableTabs | Opt_intensityStyles)
 
 /* ------------------------------------------------------------------------- */
 
index 25a56a3474ba4a11c04455c543f6fd42ef8dedb8..be0dc439b22539f673163fac1942f14972d19c45 100644 (file)
@@ -207,6 +207,7 @@ optList[] = {
               STRG (Rs_boldFont, "boldFont", "fb", "fontname", "bold font"),
               STRG (Rs_italicFont, "italicFont", "fi", "fontname", "italic font"),
               STRG (Rs_boldItalicFont, "boldItalicFont", "fbi", "fontname", "bold italic font"),
+              BOOL (Rs_intensityStyles, "intensityStyles", "is", Opt_intensityStyles, "font styles imply intensity changes"),
 #endif
 #ifdef USE_XIM
               STRG (Rs_inputMethod, "inputMethod", "im", "name", "name of input method"),