mirror of
https://github.com/veeso/termscp.git
synced 2025-12-07 09:36:00 -08:00
Fixed windows dying when opening text files
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user