From 30c746d8c522d882d50dadb2d91ced4e932cb1e3 Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 20 Jul 2006 09:35:20 -0400 Subject: [PATCH] BUG: Do not display VT100 escapes inside emacs even if TERM is set to xterm. --- Source/kwsys/Terminal.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Source/kwsys/Terminal.c b/Source/kwsys/Terminal.c index e3265a128..59b223591 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) {