Fixed windows dying when opening text files

This commit is contained in:
veeso
2021-06-19 15:01:54 +02:00
parent 4475e8c24c
commit 5a4a364250
5 changed files with 14 additions and 3 deletions

View File

@@ -103,6 +103,7 @@ impl Context {
/// ### enter_alternate_screen
///
/// Enter alternate screen (gui window)
#[cfg(not(target_os = "windows"))]
pub fn enter_alternate_screen(&mut self) {
match execute!(
self.terminal.backend_mut(),
@@ -190,9 +191,12 @@ mod tests {
assert!(ctx.get_error().is_some());
assert!(ctx.get_error().is_none());
// Try other methods
ctx.enter_alternate_screen();
ctx.clear_screen();
ctx.leave_alternate_screen();
#[cfg(not(target_os = "windows"))]
{
ctx.enter_alternate_screen();
ctx.clear_screen();
ctx.leave_alternate_screen();
}
drop(ctx);
}
}