Panic after upgrading to 0.5.3 fix (#73)

This commit is contained in:
Timon 2019-01-08 13:15:57 +01:00 committed by GitHub
parent f70baa5987
commit 674922f817
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -14,7 +14,10 @@ static ENABLE_ANSI: Once = ONCE_INIT;
pub fn try_enable_ansi_support() -> bool { pub fn try_enable_ansi_support() -> bool {
ENABLE_ANSI.call_once(|| { ENABLE_ANSI.call_once(|| {
let command = EnableAnsiCommand::new(); let command = EnableAnsiCommand::new();
let success = command.enable().unwrap(); let success = match command.enable() {
Ok(success) => { success },
Err(_) => { false },
};
set_is_windows_ansi_supportable(success); set_is_windows_ansi_supportable(success);
set_ansi_enabled(success); set_ansi_enabled(success);