From 215d0cfa836262a169fb498ad41ee7a3b7c4842f Mon Sep 17 00:00:00 2001 From: T Date: Sat, 3 Feb 2018 17:17:28 +0100 Subject: [PATCH] Use default ANSI for windows, if current windows does not support ANSI switch back to WINAPI. Unix is not tested yet. Notice that currently the console will be set to another mode and that ther is no way back, when ansi is enabled. Storing the old state of the terminal and enable the client to switsh back to the old state will likely be inplemented in crossterm 0.3.0 --- .idea/workspace.xml | 881 ++++++++++++---------- examples/bin.rs | 5 +- examples/terminal/mod.rs | 4 +- src/crossterm_cursor/cursor.rs | 25 +- src/crossterm_cursor/mod.rs | 4 - src/crossterm_style/color/ansi_color.rs | 14 +- src/crossterm_style/color/color.rs | 27 +- src/crossterm_style/color/mod.rs | 6 +- src/crossterm_terminal/ansi_terminal.rs | 17 +- src/crossterm_terminal/base_terminal.rs | 2 +- src/crossterm_terminal/mod.rs | 6 +- src/crossterm_terminal/terminal.rs | 37 +- src/crossterm_terminal/winapi_terminal.rs | 3 +- src/kernel/linux_kernel/terminal.rs | 4 +- src/kernel/windows_kernel/ansi_support.rs | 9 - src/kernel/windows_kernel/cursor.rs | 1 + src/kernel/windows_kernel/kernel.rs | 78 +- src/kernel/windows_kernel/mod.rs | 1 - src/kernel/windows_kernel/terminal.rs | 6 +- src/shared/functions.rs | 9 + src/shared/mod.rs | 1 + 21 files changed, 652 insertions(+), 488 deletions(-) delete mode 100644 src/kernel/windows_kernel/ansi_support.rs create mode 100644 src/shared/functions.rs diff --git a/.idea/workspace.xml b/.idea/workspace.xml index a0f7c4d..f693957 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,23 +2,27 @@ + - - - - - - + - - + + + - + + + + + + + + - - + + - - - - - - - - - - - - - - - - - - - - - - + + - - - - + + @@ -68,67 +50,98 @@ - + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -136,18 +149,15 @@ + + + - Coord - winapi - kernel32 - HANDLE - handleapi - terminal_cursor - terminal - r - short - console_mode set fsr_window resizeBuffer @@ -168,10 +178,23 @@ cursor::get() get() get + output_handle + UnixTerminal + size + DISABLE_NE + dwInMode + FillConsoleOutputCharacter + println + terminal + term + AnsiColor crossterm_cursor + + D:\Windows\GIT\crossterm + @@ -250,9 +276,6 @@ - - - @@ -288,12 +311,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -301,18 +363,27 @@ + + + + + +