diff options
author | Aram Drevekenin <aram@poor.dev> | 2022-10-14 17:44:23 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-14 17:44:23 +0200 |
commit | efceb562dec562babd90c711b30a5471e026fd3d (patch) | |
tree | 0d98a00319023c1f9724fc39cff018513413c6ee /zellij-server/src | |
parent | 8c2b576b670a98d891186c1cf469ca438dfd8a45 (diff) |
feat(layouts): edit panes (#1799)
* feat(layouts): edit panes
* style(fmt): rustfmt
Diffstat (limited to 'zellij-server/src')
-rw-r--r-- | zellij-server/src/pty.rs | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/zellij-server/src/pty.rs b/zellij-server/src/pty.rs index 84088b951..9151c1a15 100644 --- a/zellij-server/src/pty.rs +++ b/zellij-server/src/pty.rs @@ -536,6 +536,28 @@ impl Pty { }, } }, + Some(Run::EditFile(path_to_file, line_number)) => { + match self.bus.os_input.as_mut().unwrap().spawn_terminal( + TerminalAction::OpenFile(path_to_file, line_number), + quit_cb, + self.default_editor.clone(), + ) { + Ok((terminal_id, pid_primary, child_fd)) => { + self.id_to_child_pid.insert(terminal_id, child_fd); + new_pane_pids.push((terminal_id, None, Ok(pid_primary))); + }, + Err(SpawnTerminalError::CommandNotFound(terminal_id)) => { + new_pane_pids.push(( + terminal_id, + None, + Err(SpawnTerminalError::CommandNotFound(terminal_id)), + )); + }, + Err(e) => { + log::error!("Failed to spawn terminal: {}", e); + }, + } + }, None => { match self.bus.os_input.as_mut().unwrap().spawn_terminal( default_shell.clone(), |