mirror of https://github.com/lapce/lapce.git
fix: verify if workdir exists or use homedir
This prevents alacritty from panicking if the workspace opened doesn't exist anymore since lapce handles non-existent workspaces pretty well
This commit is contained in:
parent
fe4e684821
commit
971bd54a59
|
@ -52,7 +52,11 @@ pub fn new(
|
|||
let poll = mio::Poll::new().unwrap();
|
||||
let mut config = TermConfig::default();
|
||||
config.pty_config.working_directory =
|
||||
cwd.or_else(|| BaseDirs::new().map(|d| PathBuf::from(d.home_dir())));
|
||||
if cwd.is_some() && cwd.clone().unwrap().exists() {
|
||||
cwd
|
||||
} else {
|
||||
BaseDirs::new().map(|d| PathBuf::from(d.home_dir()))
|
||||
};
|
||||
let shell = shell.trim();
|
||||
if !shell.is_empty() {
|
||||
let mut parts = shell.split(' ');
|
||||
|
|
Loading…
Reference in New Issue