diff options
author | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2010-06-01 15:17:46 +0000 |
---|---|---|
committer | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2010-06-01 15:17:46 +0000 |
commit | 77d8322c61b7658f6a5136448a2346cbab8978ca (patch) | |
tree | 313e9d62620ce61843921f2513687569a8295242 /main | |
parent | 4499cf87b7bac11dd4dbfb9b527ab5e6c6f4d8a7 (diff) |
Prevent CLI prompt from distorting output of lines shorter than the prompt.
Uses the VT100 method of clearing the line from the cursor position to the
end of the line: Esc-0K
(closes issue #17160)
Reported by: coolmig
Patches:
20100531__issue17160.diff.txt uploaded by tilghman (license 14)
Tested by: coolmig
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@266585 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main')
-rw-r--r-- | main/asterisk.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/main/asterisk.c b/main/asterisk.c index 236e6318b..0e1306fd8 100644 --- a/main/asterisk.c +++ b/main/asterisk.c @@ -1863,7 +1863,7 @@ static int ast_el_read_char(EditLine *el, char *cp) /* Write over the CLI prompt */ if (!ast_opt_exec && !lastpos) { - if (write(STDOUT_FILENO, "\r", 1) < 0) { + if (write(STDOUT_FILENO, "\r[0K", 5) < 0) { } } if (write(STDOUT_FILENO, buf, res) < 0) { |