aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
Diffstat (limited to 'main')
-rw-r--r--main/term.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/main/term.c b/main/term.c
index d051338d8..265be1fdb 100644
--- a/main/term.c
+++ b/main/term.c
@@ -1,7 +1,7 @@
/*
* Asterisk -- An open source telephony toolkit.
*
- * Copyright (C) 1999 - 2005, Digium, Inc.
+ * Copyright (C) 1999 - 2010, Digium, Inc.
*
* Mark Spencer <markster@digium.com>
*
@@ -18,9 +18,9 @@
/*! \file
*
- * \brief Terminal Routines
+ * \brief Terminal Routines
*
- * \author Mark Spencer <markster@digium.com>
+ * \author Mark Spencer <markster@digium.com>
*/
#include "asterisk.h"
@@ -79,12 +79,21 @@ int ast_term_init(void)
char buffer[512] = "";
int termfd = -1, parseokay = 0, i;
- if (!term)
+ if (ast_opt_no_color) {
return 0;
- if (!ast_opt_console || ast_opt_no_color || !ast_opt_no_fork)
+ }
+
+ if (!ast_opt_console) {
+ /* If any remote console is not compatible, we'll strip the color codes at that point */
+ vt100compat = 1;
+ goto end;
+ }
+
+ if (!term) {
return 0;
+ }
- for (i=0 ;; i++) {
+ for (i = 0;; i++) {
if (termpath[i] == NULL) {
break;
}
@@ -138,6 +147,7 @@ int ast_term_init(void)
}
}
+end:
if (vt100compat) {
/* Make commands show up in nice colors */
snprintf(prepdata, sizeof(prepdata), "%c[%d;%d;%dm", ESC, ATTR_BRIGHT, COLOR_BROWN, COLOR_BLACK + 10);