mirror of
https://chromium.googlesource.com/crosvm/crosvm
synced 2024-11-25 05:03:05 +00:00
devices: vhost-user: console: always restore terminal capabilities
We used to bail early if an error happened while we run the console device, leaving the terminal in raw mode. BUG=None TEST=cargo build Change-Id: I3dc4a681f736246548d1cc7b7eab0bfd429587be Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3439667 Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
This commit is contained in:
parent
ffa04d7a5e
commit
5d12163091
1 changed files with 5 additions and 3 deletions
|
@ -326,14 +326,16 @@ pub fn run_console_device(program_name: &str, args: &[&str]) -> anyhow::Result<(
|
|||
stdin: true,
|
||||
};
|
||||
|
||||
if let Err(e) = run_console(¶ms, &socket) {
|
||||
bail!("error occurred: {:#}", e);
|
||||
}
|
||||
let res = run_console(¶ms, &socket);
|
||||
|
||||
// Restore terminal capabilities back to what they were before
|
||||
stdin()
|
||||
.set_canon_mode()
|
||||
.context("Failed to restore canonical mode for terminal")?;
|
||||
|
||||
if let Err(e) = res {
|
||||
bail!("error occurred: {:#}", e);
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue