fix(shell): 修复终端显示问题并优化界面

清除终端内容时保留顶部应用栏,并调整文本颜色为白色以提高可读性。同时修复了命令提示符的颜色显示问题。
This commit is contained in:
2025-09-01 09:27:20 +08:00
parent 29b1af482f
commit 42e5a053c4

View File

@@ -81,8 +81,16 @@ end
local history = {} local history = {}
while true do while true do
term.setTextColor(colors.yellow) -- 先清除控制台内容,但保留顶部应用栏
local w, h = term.getSize()
term.setTextColor(colors.white)
term.setBackgroundColor(colors.black) term.setBackgroundColor(colors.black)
for y=2, h do
term.at(1, y).clearLine()
end
term.at(1, 2)
term.setTextColor(colors.yellow)
rc.write("$ "..shell.dir().." >>> ") rc.write("$ "..shell.dir().." >>> ")
term.setTextColor(colors.white) term.setTextColor(colors.white)