terminal default to HOME

This commit is contained in:
Dongdong Zhou 2021-10-18 14:42:55 +01:00
parent 8ac6f6b909
commit 746f4c4aa3
1 changed files with 2 additions and 1 deletions

View File

@ -68,7 +68,8 @@ pub fn new(
) -> Terminal {
let poll = mio::Poll::new().unwrap();
let mut config = TermConfig::default();
config.working_directory = cwd;
config.working_directory =
cwd.or_else(|| std::env::var("HOME").ok().map(|h| PathBuf::from(h)));
config.shell = std::env::var("SHELL").ok().map(|shell| Program::WithArgs {
program: shell.to_string(),
args: vec!["-l".to_string()],