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
|
senders
|
||||||
.send_to_screen(ScreenInstruction::PtyBytes(
|
.send_to_screen(ScreenInstruction::PtyBytes(
|
||||||
terminal_id,
|
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()
|
.as_bytes()
|
||||||
.to_vec(),
|
.to_vec(),
|
||||||
))
|
))
|
||||||
|
|
|
||||||
|
|
@ -295,12 +295,20 @@ impl Action {
|
||||||
file,
|
file,
|
||||||
line_number,
|
line_number,
|
||||||
floating,
|
floating,
|
||||||
} => Ok(vec![Action::EditFile(
|
} => {
|
||||||
file,
|
let mut file = file;
|
||||||
line_number,
|
if file.is_relative() {
|
||||||
direction,
|
if let Some(cwd) = std::env::current_dir().ok() {
|
||||||
floating,
|
file = cwd.join(file);
|
||||||
)]),
|
}
|
||||||
|
}
|
||||||
|
Ok(vec![Action::EditFile(
|
||||||
|
file,
|
||||||
|
line_number,
|
||||||
|
direction,
|
||||||
|
floating,
|
||||||
|
)])
|
||||||
|
},
|
||||||
CliAction::SwitchMode { input_mode } => {
|
CliAction::SwitchMode { input_mode } => {
|
||||||
Ok(vec![Action::SwitchModeForAllClients(input_mode)])
|
Ok(vec![Action::SwitchModeForAllClients(input_mode)])
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue