From 8c2b73b8454ef9b578b248bfb6dd0e48c3b1215d Mon Sep 17 00:00:00 2001 From: Leonmmcoset Date: Sun, 31 Aug 2025 19:56:01 +0800 Subject: [PATCH] =?UTF-8?q?refactor(shell):=20=E4=BD=BF=E7=94=A8textutils.?= =?UTF-8?q?coloredPrint=E4=BC=98=E5=8C=96=E6=8F=90=E7=A4=BA=E7=AC=A6?= =?UTF-8?q?=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 将shell提示符的拼接方式改为使用textutils.coloredPrint函数,提高代码可读性和维护性 --- data/computercraft/lua/rom/programs/shell.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/computercraft/lua/rom/programs/shell.lua b/data/computercraft/lua/rom/programs/shell.lua index e1b7261..b18e0d2 100644 --- a/data/computercraft/lua/rom/programs/shell.lua +++ b/data/computercraft/lua/rom/programs/shell.lua @@ -66,7 +66,7 @@ local history = {} while true do term.setTextColor(colors.yellow) term.setBackgroundColor(colors.black) - rc.write(colors.yellow.."$"..shell.dir()..colors.green.." >>> ") + rc.write(textutils.coloredPrint(colors.yellow, "$"..shell.dir(), colors.green, " >>> ")) term.setTextColor(colors.white) local text = term.read(nil, history, shell.complete)