From 5d78499f3fda2fb8bb096b967c87560efa960c9b Mon Sep 17 00:00:00 2001 From: "leedongmyung[desktop]" Date: Sun, 5 Nov 2023 11:17:26 +0900 Subject: [PATCH] =?UTF-8?q?=EC=9C=88=EB=8F=84=EC=9A=B0=EC=97=90=EC=84=9C?= =?UTF-8?q?=20cmd=EC=9D=98=20=EC=83=89=EC=83=81=EC=9D=B4=20=EC=A0=9C?= =?UTF-8?q?=EB=8C=80=EB=A1=9C=20=EC=95=88=EB=82=98=EC=98=A4=EB=8A=94=20?= =?UTF-8?q?=EB=AC=B8=EC=A0=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/cli/cli.dart | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) 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) {