From: Lennart Poettering Date: Wed, 7 Jan 2015 22:02:08 +0000 (+0100) Subject: util: upgrade default $TERM from vt102 to vt220 if we have no idea about the connecte... X-Git-Tag: v219~637 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=commitdiff_plain;h=3c4230a5afb27faec2176d4642c0e2e145971b5c;hp=2efe2438fd65ddda79551f97bf85160e520d52d8 util: upgrade default $TERM from vt102 to vt220 if we have no idea about the connected terminal 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. --- diff --git a/src/shared/util.c b/src/shared/util.c index 64059065d..6293e967c 100644 --- a/src/shared/util.c +++ b/src/shared/util.c @@ -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) {