Implement screen clearing with Ctrl+l
This commit is contained in:
13
src/lib.rs
13
src/lib.rs
@ -522,13 +522,6 @@ pub mod shell {
|
||||
}
|
||||
},
|
||||
|
||||
Key::Ctrl('x') => {
|
||||
clear_line(&max_pos, ¤t_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(¤t_pos, &max_pos, &mycommand);
|
||||
//println!("steps: {:?} cur {:?} max {:?}", steps, current_pos, max_pos);
|
||||
|
||||
Reference in New Issue
Block a user