summaryrefslogtreecommitdiffstats
path: root/zellij-utils
diff options
context:
space:
mode:
authorAram Drevekenin <aram@poor.dev>2022-10-20 17:27:44 +0200
committerGitHub <noreply@github.com>2022-10-20 17:27:44 +0200
commitb94a626959530c30600b807af11e32e3e525241b (patch)
treea599ca8b50bec47cc64f04795791d29c2d223555 /zellij-utils
parent8431b9e0ef1c192d6b1f521731583d61de629da3 (diff)
fix(command): better error when command not found (#1829)
* fix(command): better error when command not found * fix(cli): open edit file from current cwd * style(fmt): rustfmt?
Diffstat (limited to 'zellij-utils')
-rw-r--r--zellij-utils/src/input/actions.rs20
1 files changed, 14 insertions, 6 deletions
diff --git a/zellij-utils/src/input/actions.rs b/zellij-utils/src/input/actions.rs
index e5acc0d2b..edfcd713e 100644
--- a/zellij-utils/src/input/actions.rs
+++ b/zellij-utils/src/input/actions.rs
@@ -295,12 +295,20 @@ impl Action {
file,
line_number,
floating,
- } => Ok(vec![Action::EditFile(
- file,
- line_number,
- direction,
- floating,
- )]),
+ } => {
+ let mut file = file;
+ if file.is_relative() {
+ if let Some(cwd) = std::env::current_dir().ok() {
+ file = cwd.join(file);
+ }
+ }
+ Ok(vec![Action::EditFile(
+ file,
+ line_number,
+ direction,
+ floating,
+ )])
+ },
CliAction::SwitchMode { input_mode } => {
Ok(vec![Action::SwitchModeForAllClients(input_mode)])
},