diff options
author | Björn-Egil Dahlberg <egil@erlang.org> | 2013-01-10 18:17:37 +0100 |
---|---|---|
committer | Björn-Egil Dahlberg <egil@erlang.org> | 2013-01-10 18:17:37 +0100 |
commit | 9f461fbaf0be7aba7c0b8b89be1f0b6f1141b7a5 (patch) | |
tree | a0f3d33937b296870bce43da7ddf78bfd546d622 | |
parent | b178d4d564e550456d442c1a7a08df7ffe94373e (diff) | |
parent | d3e3d51dbb21f0fdb125becacb80e34d0565fff7 (diff) | |
download | otp-9f461fbaf0be7aba7c0b8b89be1f0b6f1141b7a5.tar.gz otp-9f461fbaf0be7aba7c0b8b89be1f0b6f1141b7a5.tar.bz2 otp-9f461fbaf0be7aba7c0b8b89be1f0b6f1141b7a5.zip |
Merge branch 'pn/ansi-console/OTP-10678'
* pn/ansi-console/OTP-10678:
Support ANSI in the console
-rw-r--r-- | erts/emulator/drivers/unix/ttsl_drv.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/erts/emulator/drivers/unix/ttsl_drv.c b/erts/emulator/drivers/unix/ttsl_drv.c index b29f80a8ba..ab2abb88d1 100644 --- a/erts/emulator/drivers/unix/ttsl_drv.c +++ b/erts/emulator/drivers/unix/ttsl_drv.c @@ -912,11 +912,15 @@ static int insert_buf(byte *s, int n) lbuf[lpos++] = (CONTROL_TAG | ((Uint32) ch)); ch = 0; } while (lpos % 8); - } else if (ch == '\n' || ch == '\r') { + } else if (ch == '\e' || ch == '\n' || ch == '\r') { write_buf(lbuf + buffpos, lpos - buffpos); - outc('\r'); - if (ch == '\n') - outc('\n'); + if (ch == '\e') { + outc('\e'); + } else { + outc('\r'); + if (ch == '\n') + outc('\n'); + } if (llen > lpos) { memcpy(lbuf, lbuf + lpos, llen - lpos); } |