Implement screen clearing with Ctrl+l

This commit is contained in:
Justine Pelletreau
2023-02-24 12:17:04 +01:00
parent 0656f163fd
commit df6aee4a49
2 changed files with 7 additions and 7 deletions

View File

@ -522,13 +522,6 @@ pub mod shell {
}
},
Key::Ctrl('x') => {
clear_line(&max_pos, &current_pos);
mycommand.clear();
current_pos = 0;
max_pos = 0;
}
Key::Left => {
if current_pos > 0 {
current_pos -= 1;
@ -543,6 +536,12 @@ pub mod shell {
}
},
Key::Ctrl('l') => {
write!(stdout, "{}{}", termion::clear::All, termion::cursor::Goto(1,1));
write!(stdout, "{}{}", conf.promptline, mycommand);
},
Key::Ctrl('p') => {
let steps = find_next_space(&current_pos, &max_pos, &mycommand);
//println!("steps: {:?} cur {:?} max {:?}", steps, current_pos, max_pos);