refactor(shell): 简化 shell 提示符的颜色处理逻辑

使用字符串连接替代 textutils.coloredPrint 来简化代码,保持相同功能但减少依赖
This commit is contained in:
2025-08-31 19:23:21 +08:00
parent 826ad5f24f
commit b3676d6d63

View File

@@ -66,7 +66,7 @@ local history = {}
while true do
term.setTextColor(colors.yellow)
term.setBackgroundColor(colors.black)
rc.write(textutils.coloredPrint(colors.yellow, "$"..shell.dir(), colors.green, " >>> "))
rc.write(colors.yellow.."$"..shell.dir()..colors.green.." >>> ")
term.setTextColor(colors.white)
local text = term.read(nil, history, shell.complete)