fix(pty): do not crash when unable to set cwd (#2214)

* fix(pty): do not crash when unable to set cwd

* style(fmt): rustfmt
This commit is contained in:
Aram Drevekenin 2023-03-01 20:12:41 +01:00 committed by GitHub
parent fd19174471
commit 91b94552b6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -174,12 +174,10 @@ fn handle_openpty(
if current_dir.exists() && current_dir.is_dir() { if current_dir.exists() && current_dir.is_dir() {
command.current_dir(current_dir); command.current_dir(current_dir);
} else { } else {
// TODO: propagate this to the user log::error!(
return Err(anyhow!(
"Failed to set CWD for new pane. '{}' does not exist or is not a folder", "Failed to set CWD for new pane. '{}' does not exist or is not a folder",
current_dir.display() current_dir.display()
)) );
.context("failed to open PTY");
} }
} }
command command