diff --git a/docs/changelog.md b/docs/changelog.md index 9add92a1a..82fffaa97 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -87,6 +87,9 @@ As features stabilize some brief notes about them will accumulate here. * mux: [pane:has_unseen_output()](config/lua/pane/has_unseen_output.md) and [PaneInformation.has_unseen_output](config/lua/PaneInformation.md) now work with multiplexer panes. #2625 +* mux: attempting to split a remote pane into a different target domain could + produce a warning about the remote home directory not being readable to + the local machine or vice versa. #3442 ### 20230326-111934-3666303c diff --git a/mux/src/lib.rs b/mux/src/lib.rs index 3640ee164..28e211189 100644 --- a/mux/src/lib.rs +++ b/mux/src/lib.rs @@ -1101,10 +1101,11 @@ impl Mux { &self, command_dir: Option, pane: Option>, + target_domain: DomainId, ) -> Option { command_dir.or_else(|| { match pane { - Some(pane) => pane + Some(pane) if pane.domain_id() == target_domain => pane .get_current_working_dir() .and_then(|url| { percent_decode_str(url.path()) @@ -1123,7 +1124,7 @@ impl Mux { path } }), - None => None, + _ => None, } }) } @@ -1159,7 +1160,11 @@ impl Mux { command_dir, } => SplitSource::Spawn { command, - command_dir: self.resolve_cwd(command_dir, Some(Arc::clone(¤t_pane))), + command_dir: self.resolve_cwd( + command_dir, + Some(Arc::clone(¤t_pane)), + domain.domain_id(), + ), }, other => other, }; @@ -1303,6 +1308,7 @@ impl Mux { } None => None, }, + domain.domain_id(), ); let tab = domain