Open current dir if no arguments provided

This commit is contained in:
Jeremy Soller 2024-03-04 10:30:59 -07:00
parent ef040c4277
commit a54957ddf2
No known key found for this signature in database
GPG key ID: D02FD439211AF56F

View file

@ -636,7 +636,11 @@ impl Application for App {
}
if app.tab_model.iter().next().is_none() {
commands.push(app.open_tab(Location::Path(home_dir())));
if let Ok(current_dir) = env::current_dir() {
commands.push(app.open_tab(Location::Path(current_dir)));
} else {
commands.push(app.open_tab(Location::Path(home_dir())));
}
}
(app, Command::batch(commands))