diff options
| author | HampusM <hampus@hampusmat.com> | 2026-07-06 22:48:31 +0200 |
|---|---|---|
| committer | HampusM <hampus@hampusmat.com> | 2026-07-06 22:48:31 +0200 |
| commit | b4e8793d7ccea40da275affae00446775fa752ee (patch) | |
| tree | 5d905e539c37221af1d36fb9ce5015eee13e0dd1 /src | |
| parent | dadf2f2e6036dd8045ecb07f61e0d089469779f9 (diff) | |
feat: enable ANSI support on Windows
Diffstat (limited to 'src')
| -rw-r--r-- | src/main.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/main.rs b/src/main.rs index 13ec797..667ac62 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,5 +1,4 @@ #![cfg_attr(all(windows, not(debug_assertions)), windows_subsystem = "windows")] -use std::error::Error; use std::io::Cursor; use std::path::Path; @@ -52,8 +51,13 @@ const YELLOW: Color<f32> = Color { const RESOURCE_DIR: &str = "res"; -fn main() -> Result<(), Box<dyn Error>> +fn main() -> Result<(), EngineError> { + #[cfg(windows)] + nu_ansi_term::enable_ansi_support() + .map_err(EngineError::from_system_defined_win32_error) + .with_context(|| "Failed to enable ANSI support")?; + tracing_subscriber::registry() .with( tracing_subscriber::fmt::layer() |
