Skip to content

Commit

Permalink
add "unknown-term" package
Browse files Browse the repository at this point in the history
Add an "unknown-term" package which provides /usr/share/terminfo/u/unknown,
i.e., a terminal definition for the TERM=unknown.

Note that although ncurses defaults to TERM=unknown even if TERM is unset
(as it is by default, in OSv), unfortunately some applications such as
python don't an unset TERM well, and so TERM needs to be set to "unknown"
explicitly.

Signed-off-by: Nadav Har'El <nyh@scylladb.com>
  • Loading branch information
nyh committed Aug 29, 2018
1 parent 4185e0d commit 09f54d8
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
5 changes: 5 additions & 0 deletions unknown-term/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.PHONY: module
module:
infocmp xterm | sed 's/cud1=\(^J\|\\n\),/cud1=\\E[B,/; s/ind=\(^J\|\\n\),/ind=\\E[S,/; s/xterm/unknown/' | tic -o terminfo -
clean:
rm -rf terminfo
16 changes: 16 additions & 0 deletions unknown-term/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
This package provides terminfo definition for the "unknown" terminal type,
which is ncurses's default if TERM is missing.

Currently, we copy the host's "xterm" definition, as that is a fairly
common terminal nowadays and will "probably" work for a user with a modern
Linux terminal, although perhaps we should choose a more bare-bones VT100
definition instead.

However, QEMU has a long-standing (11 years!) bug which wrongly translates
a bare linefeed sent by the guest \n\r - see
https://bugs.launchpad.net/qemu/+bug/1407813
https://bugs.launchpad.net/qemu/+bug/1715296

So we need to modify the host's terminfo files use 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).
1 change: 1 addition & 0 deletions unknown-term/usr.manifest
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/usr/share/terminfo/u/unknown: ${MODULE_DIR}/terminfo/u/unknown

0 comments on commit 09f54d8

Please sign in to comment.