mirror of
https://github.com/nushell/nushell.git
synced 2024-11-08 01:24:38 +01:00
Exit bar visualization if any key is pressed other than left and right arrow keys. (#2623)
This commit is contained in:
parent
a56abb6502
commit
b7bc4c1f80
@ -64,6 +64,8 @@ fn display(model: &nu_data::utils::Model) -> Result<(), Box<dyn Error>> {
|
|||||||
|
|
||||||
match rx.recv()? {
|
match rx.recv()? {
|
||||||
Event::Input(event) => match event.code {
|
Event::Input(event) => match event.code {
|
||||||
|
KeyCode::Left => app.on_left(),
|
||||||
|
KeyCode::Right => app.on_right(),
|
||||||
KeyCode::Char('q') => {
|
KeyCode::Char('q') => {
|
||||||
disable_raw_mode()?;
|
disable_raw_mode()?;
|
||||||
execute!(
|
execute!(
|
||||||
@ -74,9 +76,16 @@ fn display(model: &nu_data::utils::Model) -> Result<(), Box<dyn Error>> {
|
|||||||
terminal.show_cursor()?;
|
terminal.show_cursor()?;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
KeyCode::Left => app.on_left(),
|
_ => {
|
||||||
KeyCode::Right => app.on_right(),
|
disable_raw_mode()?;
|
||||||
_ => {}
|
execute!(
|
||||||
|
terminal.backend_mut(),
|
||||||
|
LeaveAlternateScreen,
|
||||||
|
DisableMouseCapture
|
||||||
|
)?;
|
||||||
|
terminal.show_cursor()?;
|
||||||
|
break;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
Event::Tick => {}
|
Event::Tick => {}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user