Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Open paths starting with ~ from terminal click
Kirill Bulatovdcaf8a9af895
diff --git a/crates/terminal/src/terminal.rs b/crates/terminal/src/terminal.rsindex f81af1319e5..2785c1a8716 100644--- a/crates/terminal/src/terminal.rs+++ b/crates/terminal/src/terminal.rs@@ -76,7 +76,7 @@ lazy_static! {// Regex Copied from alacritty's ui_config.rsstatic ref URL_REGEX: RegexSearch = RegexSearch::new(r#"(ipfs:|ipns:|magnet:|mailto:|gemini://|gopher://|https://|http://|news:|file://|git://|ssh:|ftp://)[^\u{0000}-\u{001F}\u{007F}-\u{009F}<>"\s{-}\^⟨⟩`]+"#).unwrap();- static ref WORD_REGEX: RegexSearch = RegexSearch::new("[\\w.:/@-]+").unwrap();+ static ref WORD_REGEX: RegexSearch = RegexSearch::new("[\\w.:/@-~]+").unwrap();}///Upward flowing events, for changing the title and suchdiff --git a/crates/terminal_view/src/terminal_view.rs b/crates/terminal_view/src/terminal_view.rsindex cdb1d40efcf..bee1107d6d7 100644--- a/crates/terminal_view/src/terminal_view.rs+++ b/crates/terminal_view/src/terminal_view.rs@@ -425,6 +425,16 @@ fn possible_open_targets(let maybe_path = path_like.path_like;let potential_abs_paths = if maybe_path.is_absolute() {vec![maybe_path]+ } else if maybe_path.starts_with("~") {+ if let Some(abs_path) = maybe_path+ .strip_prefix("~")+ .ok()+ .and_then(|maybe_path| Some(dirs::home_dir()?.join(maybe_path)))+ {+ vec![abs_path]+ } else {+ Vec::new()+ }} else if let Some(workspace) = workspace.upgrade(cx) {workspace.update(cx, |workspace, cx| {workspace