diff --git a/lib/cli/cli.dart b/lib/cli/cli.dart index 684a15c..e20f6b2 100644 --- a/lib/cli/cli.dart +++ b/lib/cli/cli.dart @@ -103,12 +103,12 @@ class CLI { static String style(String message, {Color? color, Color? background, Style? style}) { - if (Platform.isWindows) { - return message; - } else { - return printer.getStyle(message, - color: color, background: background, style: style); - } + // if (Platform.isWindows) { + // return message; + // } else { + return printer.getStyle(message, + color: color, background: background, style: style); + // } } static final commandNameSpace = 18; @@ -221,6 +221,12 @@ class _PrinterWindows extends Printer { } } message.writeln(':setESC'); + message.writeln( + '''for /F "tokens=1,2 delims=#" %%a in ('"prompt #\$H#\$E# & echo on & for %%b in (1) do rem"') do ('''); + message.writeln(' set ESC=%%b'); + message.writeln(' exit /B 0'); + message.writeln(')'); + message.writeln('exit /B 0'); var temp = await getTempFile(message.toString(), 'bat'); await Process.run('cmd', ['/C', temp.path]).then((ProcessResult result) {