DJSD requests a force-monochrome option for users who dislike angry-
authorsimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Tue, 9 Nov 2004 17:57:32 +0000 (17:57 +0000)
committersimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Tue, 9 Nov 2004 17:57:32 +0000 (17:57 +0000)
fruit-salad applications :-)

git-svn-id: svn://svn.tartarus.org/sgt/putty@4762 cda61777-01e9-0310-a592-d414129be87e

config.c
doc/config.but
putty.h
settings.c
terminal.c
winhelp.h

index 7898c7a..a7325a1 100644 (file)
--- a/config.c
+++ b/config.c
@@ -1233,6 +1233,9 @@ void setup_config_box(struct controlbox *b, struct sesslist *sesslist,
 
     s = ctrl_getset(b, "Window/Colours", "general",
                    "General options for colour usage");
+    ctrl_checkbox(s, "Allow terminal to specify ANSI colours", 'i',
+                 HELPCTX(colours_ansi),
+                 dlg_stdcheckbox_handler, I(offsetof(Config,ansi_colour)));
     ctrl_checkbox(s, "Bolded text is a different colour", 'b',
                  HELPCTX(colours_bold),
                  dlg_stdcheckbox_handler, I(offsetof(Config,bold_colour)));
index 5498c6c..59a551f 100644 (file)
@@ -1,4 +1,4 @@
-\versionid $Id: config.but,v 1.96 2004/10/24 18:26:00 jacob Exp $
+\versionid $Id: config.but,v 1.97 2004/11/09 17:57:32 simon Exp $
 
 \C{config} Configuring PuTTY
 
@@ -1389,6 +1389,18 @@ immediately.
 
 The Colours panel allows you to control PuTTY's use of colour.
 
+\S{config-ansicolour} \q{Allow terminal to specify ANSI colours}
+
+\cfg{winhelp-topic}{colours.ansi}
+
+This option is enabled by default. If it is disabled, PuTTY will
+ignore any control sequences sent by the server to request coloured
+text.
+
+If you have a particularly garish application, you might want to
+turn this option off and make PuTTY only use the default foreground
+and background colours.
+
 \S{config-boldcolour} \q{Bolded text is a different colour}
 
 \cfg{winhelp-topic}{colours.bold}
diff --git a/putty.h b/putty.h
index 81cb5c5..061f627 100644 (file)
--- a/putty.h
+++ b/putty.h
@@ -444,6 +444,7 @@ struct config_tag {
     int arabicshaping;
     int bidi;
     /* Colour options */
+    int ansi_colour;
     int system_colour;
     int try_palette;
     int bold_colour;
index a8f7091..4f65fc5 100644 (file)
@@ -288,6 +288,7 @@ void save_open_settings(void *sesskey, int do_host, Config *cfg)
     write_setting_i(sesskey, "FontVTMode", cfg->vtmode);
     write_setting_i(sesskey, "UseSystemColours", cfg->system_colour);
     write_setting_i(sesskey, "TryPalette", cfg->try_palette);
+    write_setting_i(sesskey, "ANSIColour", cfg->ansi_colour);
     write_setting_i(sesskey, "BoldAsColour", cfg->bold_colour);
 
     for (i = 0; i < 22; i++) {
@@ -553,6 +554,7 @@ void load_open_settings(void *sesskey, int do_host, Config *cfg)
     gppi(sesskey, "FontVTMode", VT_UNICODE, (int *) &cfg->vtmode);
     gppi(sesskey, "UseSystemColours", 0, &cfg->system_colour);
     gppi(sesskey, "TryPalette", 0, &cfg->try_palette);
+    gppi(sesskey, "ANSIColour", 1, &cfg->ansi_colour);
     gppi(sesskey, "BoldAsColour", 1, &cfg->bold_colour);
 
     for (i = 0; i < 22; i++) {
index 1a65e71..25c2cfd 100644 (file)
@@ -4447,6 +4447,10 @@ static void do_paint(Terminal *term, Context ctx, int may_optimise)
            tchar = d->chr;
            tattr = d->attr;
 
+            if (!term->cfg.ansi_colour)
+                tattr = (tattr & ~(ATTR_FGMASK | ATTR_BGMASK)) | 
+                ATTR_DEFFG | ATTR_DEFBG;
+
            switch (tchar & CSET_MASK) {
              case CSET_ASCII:
                tchar = term->ucsdata->unitab_line[tchar & 0xFF];
index 508c0e5..ea6d028 100644 (file)
--- a/winhelp.h
+++ b/winhelp.h
@@ -96,6 +96,7 @@
 #define WINHELP_CTX_selection_charclasses "selection.charclasses"
 #define WINHELP_CTX_selection_linedraw "selection.linedraw"
 #define WINHELP_CTX_selection_rtf "selection.rtf"
+#define WINHELP_CTX_colours_ansi "colours.ansi"
 #define WINHELP_CTX_colours_bold "colours.bold"
 #define WINHELP_CTX_colours_system "colours.system"
 #define WINHELP_CTX_colours_logpal "colours.logpal"