From 7850378e15cf9e0a7f0ba9671b7beb63d892e4e6 Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Mon, 15 May 2023 14:03:30 +0200 Subject: [PATCH] Fix issue with messed up linewrap in qemu-system-x86_64 Apparently the qemu-system-x86_64 in -nographics mode does all sorts of crazy things to the terminal. Most annoying, it disables linewrap. Signed-off-by: Joachim Wiberg --- src/helpers.c | 3 +++ src/stty.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/helpers.c b/src/helpers.c index 883fcd00..3e21400d 100644 --- a/src/helpers.c +++ b/src/helpers.c @@ -84,6 +84,9 @@ char *console(void) void console_init(void) { + /* Enable line wrap, if disabled previously, e.g., qemu */ + dprint(STDOUT_FILENO, "\033[?7h", 5); + log_init(); } diff --git a/src/stty.c b/src/stty.c index 3ec7708a..d20de5aa 100644 --- a/src/stty.c +++ b/src/stty.c @@ -132,7 +132,7 @@ void stty(int fd, speed_t speed) dprint(fd, "\033[?25h", 6); /* Enable line wrap, if disabled previously */ - dprint(fd, "\033[7h", 4); + dprint(fd, "\033[?7h", 5); } /**