summaryrefslogtreecommitdiffstats
path: root/Source/kwsys
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2006-07-20 13:35:20 (GMT)
committerBrad King <brad.king@kitware.com>2006-07-20 13:35:20 (GMT)
commit30c746d8c522d882d50dadb2d91ced4e932cb1e3 (patch)
tree3e512b31c6f438146e28e766d9d293fff85576e7 /Source/kwsys
parent44508f7e79f296b8c0236e347fb258065a01b144 (diff)
downloadCMake-30c746d8c522d882d50dadb2d91ced4e932cb1e3.zip
CMake-30c746d8c522d882d50dadb2d91ced4e932cb1e3.tar.gz
CMake-30c746d8c522d882d50dadb2d91ced4e932cb1e3.tar.bz2
BUG: Do not display VT100 escapes inside emacs even if TERM is set to xterm.
Diffstat (limited to 'Source/kwsys')
-rw-r--r--Source/kwsys/Terminal.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/Source/kwsys/Terminal.c b/Source/kwsys/Terminal.c
index e3265a1..59b2235 100644
--- a/Source/kwsys/Terminal.c
+++ b/Source/kwsys/Terminal.c
@@ -160,6 +160,15 @@ static const char* kwsysTerminalVT100Names[] =
static int kwsysTerminalStreamIsVT100(FILE* stream, int default_vt100,
int default_tty)
{
+ /* If running inside emacs the terminal is not VT100. Some emacs
+ seem to claim the TERM is xterm even though they do not support
+ VT100 escapes. */
+ const char* emacs = getenv("EMACS");
+ if(emacs && *emacs == 't')
+ {
+ return 0;
+ }
+
/* Check for a valid terminal. */
if(!default_vt100)
{