summaryrefslogtreecommitdiffstats
path: root/crawl-ref
diff options
context:
space:
mode:
Diffstat (limited to 'crawl-ref')
-rw-r--r--crawl-ref/source/AppHdr.h5
-rw-r--r--crawl-ref/source/initfile.cc22
2 files changed, 15 insertions, 12 deletions
diff --git a/crawl-ref/source/AppHdr.h b/crawl-ref/source/AppHdr.h
index ef65c1288f..4014edab30 100644
--- a/crawl-ref/source/AppHdr.h
+++ b/crawl-ref/source/AppHdr.h
@@ -64,10 +64,7 @@
// especially bad, so we'll want to remap that. OS X is otherwise
// Unix-ish, so we shouldn't need other special handling.
//
-#if defined(TARGET_OS_MACOSX)
- #define USE_8_COLOUR_TERM_MAP
- #define COL_TO_REPLACE_DARKGREY BLUE
-#endif
+#define COL_TO_REPLACE_DARKGREY BLUE
//
// FreeBSD
diff --git a/crawl-ref/source/initfile.cc b/crawl-ref/source/initfile.cc
index 2a796af899..a5b1a86a72 100644
--- a/crawl-ref/source/initfile.cc
+++ b/crawl-ref/source/initfile.cc
@@ -961,14 +961,20 @@ void game_options::reset_options()
#endif
// map each colour to itself as default
-#ifdef USE_8_COLOUR_TERM_MAP
- for (int i = 0; i < 16; i++)
- colour[i] = i % 8;
-
- colour[ DARKGREY ] = COL_TO_REPLACE_DARKGREY;
-#else
- for (int i = 0; i < 16; i++)
- colour[i] = i;
+ // If USE_8_COLOUR_TERM_MAP is defined, then we force 8 colors.
+ // Otherwise, do a check to see if we're using Apple_Terminal.
+#ifndef USE_8_COLOUR_TERM_MAP
+ if (strcmp(getenv("TERM_PROGRAM"), "Apple_Terminal") == 0) {
+#endif
+ for (int i = 0; i < 16; i++)
+ colour[i] = i % 8;
+
+ colour[ DARKGREY ] = COL_TO_REPLACE_DARKGREY;
+#ifndef USE_8_COLOUR_TERM_MAP
+ } else {
+ for (int i = 0; i < 16; i++)
+ colour[i] = i;
+ }
#endif
// map each channel to plain (well, default for now since I'm testing)