diff --git a/src/tab.rs b/src/tab.rs index 4ab47f8..3ea924b 100644 --- a/src/tab.rs +++ b/src/tab.rs @@ -1469,8 +1469,10 @@ impl Location { if let Ok(canonical) = fs::canonicalize(&path) { path = canonical; } - // Add trailing slash if location is a path - path.push(""); + // Add trailing slash if location is a directory + if path.is_dir() { + path.push(""); + } self.with_path(path) } else { self.clone()