summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--com32/lib/sys/ansi.c2
-rw-r--r--com32/lib/sys/stdcon_write.c2
-rw-r--r--com32/lib/sys/xserial_write.c5
-rw-r--r--com32/menu/vesamenu.c4
4 files changed, 8 insertions, 5 deletions
diff --git a/com32/lib/sys/ansi.c b/com32/lib/sys/ansi.c
index 5af4a760..29a069f0 100644
--- a/com32/lib/sys/ansi.c
+++ b/com32/lib/sys/ansi.c
@@ -46,7 +46,7 @@ static const struct term_state default_state =
.reverse = 0,
.fg = 7,
.bg = 0,
- .autocr = 0,
+ .autocr = 1, /* Mimic \n -> \r\n conversion by default */
.saved_xy = { 0, 0 },
.cursor = 1,
.state = st_init,
diff --git a/com32/lib/sys/stdcon_write.c b/com32/lib/sys/stdcon_write.c
index ef51b76f..458d2c26 100644
--- a/com32/lib/sys/stdcon_write.c
+++ b/com32/lib/sys/stdcon_write.c
@@ -28,7 +28,7 @@
/*
* stdcon_write.c
*
- * Writing to the console
+ * Writing to the console; \n -> \r\n conversion.
*/
#include <errno.h>
diff --git a/com32/lib/sys/xserial_write.c b/com32/lib/sys/xserial_write.c
index ef540d48..6d0d0f79 100644
--- a/com32/lib/sys/xserial_write.c
+++ b/com32/lib/sys/xserial_write.c
@@ -28,7 +28,7 @@
/*
* xserial_write.c
*
- * Raw writing to the serial port; no \n -> \r\n translation, but
+ * Raw writing to the serial port; \n -> \r\n translation, and
* convert \1# sequences.
*/
@@ -73,6 +73,9 @@ ssize_t __xserial_write(struct file_info *fp, const void *buf, size_t count)
if (ch >= 1 && ch <= 5) {
state = st_tbl;
ndigits = ch;
+ } else if (ch == '\n') {
+ emit('\r');
+ emit('\n');
} else {
emit(ch);
}
diff --git a/com32/menu/vesamenu.c b/com32/menu/vesamenu.c
index cebbb344..094b8f65 100644
--- a/com32/menu/vesamenu.c
+++ b/com32/menu/vesamenu.c
@@ -27,13 +27,13 @@
void console_prepare(void)
{
- fputs("\033[0m\033[20h\033[25l", stdout);
+ fputs("\033[0m\033[25l", stdout);
}
void console_cleanup(void)
{
/* For the serial console, be nice and clean up */
- fputs("\033[0m\033[20l", stdout);
+ fputs("\033[0m", stdout);
}
int draw_background(const char *what)