aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/drivers/unix/ttsl_drv.c
diff options
context:
space:
mode:
authorDeadZen <[email protected]>2012-11-08 19:36:07 -0500
committerDeadZen <[email protected]>2012-11-08 19:36:07 -0500
commitd3e3d51dbb21f0fdb125becacb80e34d0565fff7 (patch)
treee1c020367a2783b9f49e64f0d428e9e3de2ead18 /erts/emulator/drivers/unix/ttsl_drv.c
parentacdfec8baf27093b59cd25ffbc84e6165f9bb427 (diff)
downloadotp-d3e3d51dbb21f0fdb125becacb80e34d0565fff7.tar.gz
otp-d3e3d51dbb21f0fdb125becacb80e34d0565fff7.tar.bz2
otp-d3e3d51dbb21f0fdb125becacb80e34d0565fff7.zip
Support ANSI in the console
Diffstat (limited to 'erts/emulator/drivers/unix/ttsl_drv.c')
-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);
}