Autocompleting to command when starting with sudo or watch
This commit is contained in:
parent
cf6a9961d1
commit
0d57b7a40c
@ -713,7 +713,7 @@ pub mod shell {
|
||||
&elems.conf.update_prompt(get_curr_history_number());
|
||||
|
||||
//Initializing
|
||||
write!(elems.stdout, "\r\n ---Sqish initializing--- \r\n{}", elems.conf.promptline);
|
||||
//write!(elems.stdout, "\r\n ---Sqish initializing--- \r\n{}", elems.conf.promptline);
|
||||
elems.stdout.flush();
|
||||
set_envvars(&elems.conf.env);
|
||||
|
||||
|
@ -109,10 +109,15 @@ impl Search {
|
||||
|
||||
fn discriminate_search_type(input: &String) -> SearchType {
|
||||
let tamere = input.clone();
|
||||
|
||||
//Special cases
|
||||
//./Means we want to execute something in place
|
||||
if input.starts_with("./") || input.starts_with(" ./") {
|
||||
return SearchType::FileSearch;
|
||||
}
|
||||
if input.starts_with("sudo") || input.starts_with("watch ") {
|
||||
return SearchType::CmdSearch;
|
||||
}
|
||||
|
||||
let mut a = tamere.split(" ").collect::<Vec<&str>>();
|
||||
let _y = String::from(a.pop().unwrap());
|
||||
|
Loading…
x
Reference in New Issue
Block a user