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?
This commit is contained in:
parent
8431b9e0ef
commit
b94a626959
2 changed files with 15 additions and 7 deletions
|
|
@ -751,7 +751,7 @@ fn send_command_not_found_to_screen(
|
|||
senders
|
||||
.send_to_screen(ScreenInstruction::PtyBytes(
|
||||
terminal_id,
|
||||
format!("Command not found: {}", run_command.command.display())
|
||||
format!("Command not found: {}\n\rIf you were including arguments as part of the command, try including them as 'args' instead.", run_command.command.display())
|
||||
.as_bytes()
|
||||
.to_vec(),
|
||||
))
|
||||
|
|
|
|||
|
|
@ -295,12 +295,20 @@ impl Action {
|
|||
file,
|
||||
line_number,
|
||||
floating,
|
||||
} => Ok(vec![Action::EditFile(
|
||||
} => {
|
||||
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)])
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue