From 73fd95dbe2cf7a07e0445e1fac550fff797b9987 Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 12 Apr 2024 01:52:18 -0700 Subject: [PATCH] guest: init: default to xterm if TERM is not set (#52) Most terminal emulators support the xterm control codes more faithfully than the vt100 ones. Fixes #51. Signed-off-by: Ariadne Conill --- crates/guest/src/init.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/crates/guest/src/init.rs b/crates/guest/src/init.rs index b2fb6c9..ca7cc25 100644 --- a/crates/guest/src/init.rs +++ b/crates/guest/src/init.rs @@ -420,7 +420,12 @@ impl GuestInit { } env.extend(launch.env.clone()); env.insert("KRATA_CONTAINER".to_string(), "1".to_string()); - env.insert("TERM".to_string(), "vt100".to_string()); + + // If we were not provided a terminal definition in our launch manifest, we + // default to xterm as most terminal emulators support the xterm control codes. + if !env.contains_key("TERM") { + env.insert("TERM".to_string(), "xterm".to_string()); + } let path = GuestInit::resolve_executable(&env, path.into())?; let Some(file_name) = path.file_name() else {