From 746f4c4aa3636fef7b39cc1e83f2d22f3f2156af Mon Sep 17 00:00:00 2001 From: Dongdong Zhou Date: Mon, 18 Oct 2021 14:42:55 +0100 Subject: [PATCH] terminal default to HOME --- proxy/src/terminal.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/proxy/src/terminal.rs b/proxy/src/terminal.rs index 56614183..698c05aa 100644 --- a/proxy/src/terminal.rs +++ b/proxy/src/terminal.rs @@ -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()],