From c6f1b8ed877667ff8b75e5dda5a89cd54ffccfbb Mon Sep 17 00:00:00 2001 From: simon Date: Tue, 9 Nov 2004 17:57:32 +0000 Subject: [PATCH] DJSD requests a force-monochrome option for users who dislike angry- fruit-salad applications :-) git-svn-id: svn://svn.tartarus.org/sgt/putty@4762 cda61777-01e9-0310-a592-d414129be87e --- config.c | 3 +++ doc/config.but | 14 +++++++++++++- putty.h | 1 + settings.c | 2 ++ terminal.c | 4 ++++ winhelp.h | 1 + 6 files changed, 24 insertions(+), 1 deletion(-) diff --git a/config.c b/config.c index 7898c7a8..a7325a1d 100644 --- 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))); diff --git a/doc/config.but b/doc/config.but index 5498c6c0..59a551fc 100644 --- a/doc/config.but +++ b/doc/config.but @@ -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 81cb5c5f..061f6275 100644 --- 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; diff --git a/settings.c b/settings.c index a8f70917..4f65fc5d 100644 --- a/settings.c +++ b/settings.c @@ -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++) { diff --git a/terminal.c b/terminal.c index 1a65e71b..25c2cfda 100644 --- a/terminal.c +++ b/terminal.c @@ -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]; diff --git a/winhelp.h b/winhelp.h index 508c0e54..ea6d0286 100644 --- 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" -- 2.11.0