Skip to content

Commit

Permalink
fix(plugins): various cwd fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
imsnif committed Aug 7, 2024
1 parent 47caeb6 commit a66aba1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
5 changes: 4 additions & 1 deletion zellij-server/src/plugins/zellij_exports.rs
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,10 @@ fn open_command_pane_background(
context: BTreeMap<String, String>,
) {
let command = command_to_run.path;
let cwd = command_to_run.cwd.map(|cwd| env.plugin_cwd.join(cwd));
let cwd = command_to_run
.cwd
.map(|cwd| env.plugin_cwd.join(cwd))
.or_else(|| Some(env.plugin_cwd.clone()));
let args = command_to_run.args;
let direction = None;
let hold_on_close = true;
Expand Down
6 changes: 6 additions & 0 deletions zellij-utils/src/kdl/kdl_layout_parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1177,6 +1177,9 @@ impl<'a> KdlLayoutParser<'a> {
};
if let Some(cwd_prefix) = &self.cwd_prefix(tab_cwd.as_ref())? {
pane_layout.add_cwd_to_layout(&cwd_prefix);
for floating_pane in child_floating_panes.iter_mut() {
floating_pane.add_cwd_to_layout(&cwd_prefix);
}
}
Ok((is_focused, tab_name, pane_layout, child_floating_panes))
}
Expand Down Expand Up @@ -1583,6 +1586,9 @@ impl<'a> KdlLayoutParser<'a> {
}
if let Some(cwd_prefix) = self.cwd_prefix(tab_cwd.as_ref())? {
tab_layout.add_cwd_to_layout(&cwd_prefix);
for floating_pane in tab_template_floating_panes.iter_mut() {
floating_pane.add_cwd_to_layout(&cwd_prefix);
}
}
tab_layout.external_children_index = None;
Ok((
Expand Down

0 comments on commit a66aba1

Please sign in to comment.