Skip to content

Commit

Permalink
Fix enabling ANSI support when stdout is redirected. (crossterm-rs#497)
Browse files Browse the repository at this point in the history
  • Loading branch information
dsherret authored Oct 10, 2020
1 parent efb06b8 commit 4b1c857
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ansi_support.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crossterm_winapi::ConsoleMode;
use crossterm_winapi::{ConsoleMode, Handle};
use winapi::um::wincon::ENABLE_VIRTUAL_TERMINAL_PROCESSING;

use lazy_static::lazy_static;
Expand All @@ -17,7 +17,7 @@ use crate::Result;
pub(crate) fn set_virtual_terminal_processing(yes: bool) -> Result<()> {
let mask = ENABLE_VIRTUAL_TERMINAL_PROCESSING;

let console_mode = ConsoleMode::new()?;
let console_mode = ConsoleMode::from(Handle::current_out_handle()?);
let old_mode = console_mode.mode()?;

let new_mode = if yes {
Expand Down

0 comments on commit 4b1c857

Please sign in to comment.