adapt write_term family, add handling for EOF actions.

This commit is contained in:
Mark Thom
2020-05-04 21:17:06 -06:00
parent 0d7a9f32d6
commit dd247cd541
5 changed files with 169 additions and 97 deletions

View File

@@ -42,6 +42,11 @@ pub mod readline {
}
impl ReadlineStream {
pub fn new(pending_input: String) -> Self {
let rl = Editor::<()>::new();
ReadlineStream { rl, pending_input: Cursor::new(pending_input) }
}
pub fn input_stream(pending_input: String) -> Stream {
let mut rl = Editor::<()>::new();
rl.bind_sequence(KeyPress::Tab, Cmd::Insert(1, "\t".to_string()));