diff options
author | Aram Drevekenin <aram@poor.dev> | 2023-02-27 16:34:31 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-27 16:34:31 +0100 |
commit | 149cafc6d66086c5f42c3f2f82c442d438e5b2c4 (patch) | |
tree | 89c11faf8a90d82b68d0b47b82398c543ddcfa4e /zellij-server/src/os_input_output.rs | |
parent | d20720f443c9b934f4db13701fd6f30202a773de (diff) |
fix(cli): edit cwd (#2201)
* fix(cli): properly set cwd for edit panes
* fix(layouts): properly set cwd for edit panes
* style(fmt): rustfmt
Diffstat (limited to 'zellij-server/src/os_input_output.rs')
-rw-r--r-- | zellij-server/src/os_input_output.rs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/zellij-server/src/os_input_output.rs b/zellij-server/src/os_input_output.rs index 6e11f5ed6..a3e1fa10e 100644 --- a/zellij-server/src/os_input_output.rs +++ b/zellij-server/src/os_input_output.rs @@ -277,7 +277,12 @@ fn spawn_terminal( // secondary fd let mut failover_cmd_args = None; let cmd = match terminal_action { - TerminalAction::OpenFile(file_to_open, line_number) => { + TerminalAction::OpenFile(mut file_to_open, line_number, cwd) => { + if file_to_open.is_relative() { + if let Some(cwd) = cwd.as_ref() { + file_to_open = cwd.join(file_to_open); + } + } let mut command = default_editor.unwrap_or_else(|| { PathBuf::from( env::var("EDITOR") @@ -318,7 +323,7 @@ fn spawn_terminal( RunCommand { command, args, - cwd: None, + cwd, hold_on_close: false, hold_on_start: false, } |