Skip to content

Commit

Permalink
guest: init: default to xterm if TERM is not set (#52)
Browse files Browse the repository at this point in the history
Most terminal emulators support the xterm control codes more faithfully than the
vt100 ones.

Fixes #51.

Signed-off-by: Ariadne Conill <[email protected]>
  • Loading branch information
kaniini authored Apr 12, 2024
1 parent f41a1e2 commit 73fd95d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion crates/guest/src/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 73fd95d

Please sign in to comment.