mirror of
https://github.com/CCLeonOS/LeonOS.git
synced 2026-03-03 15:17:01 +00:00
refactor(shell): 使用textutils.coloredPrint优化提示符显示
将shell提示符的拼接方式改为使用textutils.coloredPrint函数,提高代码可读性和维护性
This commit is contained in:
@@ -66,7 +66,7 @@ local history = {}
|
|||||||
while true do
|
while true do
|
||||||
term.setTextColor(colors.yellow)
|
term.setTextColor(colors.yellow)
|
||||||
term.setBackgroundColor(colors.black)
|
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)
|
term.setTextColor(colors.white)
|
||||||
|
|
||||||
local text = term.read(nil, history, shell.complete)
|
local text = term.read(nil, history, shell.complete)
|
||||||
|
|||||||
Reference in New Issue
Block a user