diff --git a/core/src/manager/tab.rs b/core/src/manager/tab.rs index 1aab30e1..01367f6d 100644 --- a/core/src/manager/tab.rs +++ b/core/src/manager/tab.rs @@ -146,7 +146,7 @@ impl Tab { emit!(Input(InputOpt::top("Change directory:").with_value(target.to_string_lossy()))); if let Some(Ok(s)) = result.recv().await { - emit!(Cd(Url::from(s))); + emit!(Cd(Url::from(s.trim()))); } }); false diff --git a/shared/src/url.rs b/shared/src/url.rs index 94fd227a..10e45db3 100644 --- a/shared/src/url.rs +++ b/shared/src/url.rs @@ -42,15 +42,15 @@ impl From<&Path> for Url { } impl From for Url { - fn from(path: String) -> Self { Self::from(PathBuf::from(path.trim())) } + fn from(path: String) -> Self { Self::from(PathBuf::from(path)) } } impl From<&String> for Url { - fn from(path: &String) -> Self { Self::from(PathBuf::from(path.trim())) } + fn from(path: &String) -> Self { Self::from(PathBuf::from(path)) } } impl From<&str> for Url { - fn from(path: &str) -> Self { Self::from(PathBuf::from(path.trim())) } + fn from(path: &str) -> Self { Self::from(PathBuf::from(path)) } } impl AsRef for Url {