aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator
diff options
context:
space:
mode:
authorBjörn-Egil Dahlberg <[email protected]>2013-01-10 18:17:37 +0100
committerBjörn-Egil Dahlberg <[email protected]>2013-01-10 18:17:37 +0100
commit9f461fbaf0be7aba7c0b8b89be1f0b6f1141b7a5 (patch)
treea0f3d33937b296870bce43da7ddf78bfd546d622 /erts/emulator
parentb178d4d564e550456d442c1a7a08df7ffe94373e (diff)
parentd3e3d51dbb21f0fdb125becacb80e34d0565fff7 (diff)
downloadotp-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
Diffstat (limited to 'erts/emulator')
-rw-r--r--erts/emulator/drivers/unix/ttsl_drv.c12
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);
}