diff options
author | D Tucny <d@tucny.com> | 2015-05-01 20:50:22 -0400 |
---|---|---|
committer | dant <d@tucny.com> | 2015-05-01 22:17:17 -0500 |
commit | e4f0a55f7f8ab262c5fbb0c4b9b20b2502f0c1f5 (patch) | |
tree | 0a26595a145d9d3128f38ac1d46d72e2ed7101b6 | |
parent | 01f3d5b7d4821e9c7fc21982814eb2c137f1d8d9 (diff) |
term: send proper reset sequence when black background is forced
When using the force black background command-line option or configuration
option an invalid reset sequence is sent following a coloured output item
in the CLI, the result is that the colour is not 'turned off' and continues
until the next non-default coloured text output.
A reset sequence is already defined in term.c, but the ast_term_reset
function doesn't use it, instead building it's own invalid sequence and
returning that.
This patch changes that behaviour, removing the building of a reset sequence
and instead using the pre-built constant 'enddata' which is a suitable reset
sequence for this purpose.
ASTERISK-24896 #close
Reported by: Dan Tucny
Change-Id: I56323899123ae3264900389cae1f5b252aa3bf43
-rw-r--r-- | main/term.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/main/term.c b/main/term.c index a19c1f144..cf21719ae 100644 --- a/main/term.c +++ b/main/term.c @@ -311,8 +311,7 @@ const char *ast_term_color(int fgcolor, int bgcolor) const char *ast_term_reset(void) { if (ast_opt_force_black_background) { - static const char reset[] = { ESC, '[', COLOR_BLACK + 10, 'm', 0 }; - return reset; + return enddata; } else { return quitdata; } |