From: Nadav Har'El <n...@scylladb.com>
Committer: Nadav Har'El <n...@scylladb.com>
Branch: master

ncurses: fix terminfo

We already know that QEMU has a bug which wrongly translates a bare linefeed
sent by the guest (intentionally!) to \n\r - this bug is known for 11 years
now, see

    https://bugs.launchpad.net/qemu/+bug/1407813
    https://bugs.launchpad.net/qemu/+bug/1715296

So if we take the host's terminfo files and want to use it in the guest, we
need to avoid using \n for moving the cursor directly down - because in qemu
it doesn't (the extra \r causes the cursor to move to the *beginning* of that
line).

We had a sed script to use something else instead of \n, but it assumed
the file has the text "^J" and doesn't work if the file had "\n" - as it
now does in Fedora 27 for example. So update the sed script to allow both.

Signed-off-by: Nadav Har'El <n...@scylladb.com>

---
diff --git a/modules/ncurses/Makefile b/modules/ncurses/Makefile
--- a/modules/ncurses/Makefile
+++ b/modules/ncurses/Makefile
@@ -39,7 +39,7 @@ $(NCURSES_ARCHIVE): | $(DOWNLOAD)

 $(TI_VT100): $(MAIN)
        @mkdir -p $(OUT)/terminfo
- infocmp vt100 | sed 's/cud1=^J,/cud1=\\E[B,/; s/ind=^J,/ind=\\E[S,/; s/vt100/vt100-qemu/' \ + infocmp vt100 | sed 's/cud1=\(^J\|\\n\),/cud1=\\E[B,/; s/ind=\(^J\| \\n\),/ind=\\E[S,/; s/vt100/vt100-qemu/' \
                > $(OUT)/terminfo.tmp
        tic -o $(OUT)/terminfo $(OUT)/terminfo.tmp
        rm -f $(OUT)/terminfo.tmp

--
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to