Fixed line returns
This commit is contained in:
12
src/lib.rs
12
src/lib.rs
@ -101,7 +101,7 @@ pub mod shell {
|
||||
.spawn() {
|
||||
Ok(h) => h,
|
||||
Err(_) => {
|
||||
let err_string = format!("Command not found : {}\r\n", command);
|
||||
let err_string = format!("Not found : {}", command);
|
||||
return String::from(err_string);
|
||||
},
|
||||
};
|
||||
@ -215,19 +215,19 @@ pub mod shell {
|
||||
if conf.aliases.contains_key(mycommand) {
|
||||
*mycommand = conf.aliases[mycommand].clone();
|
||||
}
|
||||
if (mycommand != &String::from("\n")) && (mycommand != &String::from("exit")) {
|
||||
if (mycommand != &String::from("")) && (mycommand != &String::from("exit")) {
|
||||
let comm = replace_signs(&mycommand);
|
||||
RawTerminal::suspend_raw_mode(&stdout);
|
||||
let res = handle_input(&comm);
|
||||
RawTerminal::activate_raw_mode(&stdout);
|
||||
mycommand.clear();
|
||||
for line in res.split('\n') {
|
||||
if line != "\r" {
|
||||
write!(stdout, "\r\n{}", line);
|
||||
for line in res.split("\r\n") {
|
||||
if line != "" && line.starts_with('N'){
|
||||
write!(stdout, "{}\r\n", line);
|
||||
}
|
||||
}
|
||||
conf.update_prompt(get_curr_history_number());
|
||||
write!(stdout, "\r\n{}", conf.promptline).unwrap();
|
||||
write!(stdout, "{}", conf.promptline).unwrap();
|
||||
stdout.flush();
|
||||
*current_number += 1;
|
||||
} else if mycommand == &String::from("exit") {
|
||||
|
||||
Reference in New Issue
Block a user