chiark / gitweb /
util: upgrade default $TERM from vt102 to vt220 if we have no idea about the connecte...
authorLennart Poettering <lennart@poettering.net>
Wed, 7 Jan 2015 22:02:08 +0000 (23:02 +0100)
committerLennart Poettering <lennart@poettering.net>
Wed, 7 Jan 2015 22:44:08 +0000 (23:44 +0100)
So far, if we had no knowledge about the correct $TERM we defaulted to
v102, as a safe, conservative choice. However, the terminfo data for
vt102 is not aware of pageup/pagedown, which makes "less" much harder
work with than necessary. Setting vt220 allows them to work correctly.

"vt220" should be a sufficiently safe choice too, given that xterm,
gnome-terminal and the linux console all strive to implement vt220 as
baseline, already to pass pageup/pagedown correctly to apps.

Effectively, with this change "journalctl -e" run inside a
"systemd-nspawn" terminal will now run a pager where pageup/pagedown
works, which is quite an improvement of usability for containers.

src/shared/util.c

index 64059065d86537e97dd93ab7ffec953d22497df1..6293e967c8fb4c7c929a14a3578be04efcfe39c6 100644 (file)
@@ -4005,7 +4005,7 @@ bool tty_is_vc_resolve(const char *tty) {
 const char *default_term_for_tty(const char *tty) {
         assert(tty);
 
-        return tty_is_vc_resolve(tty) ? "TERM=linux" : "TERM=vt102";
+        return tty_is_vc_resolve(tty) ? "TERM=linux" : "TERM=vt220";
 }
 
 bool dirent_is_file(const struct dirent *de) {