Closed Nex4rius closed 7 years ago
technically -- no screen is turned "off"
Instead, what you are likely seeing is that OpenOS clears the currently bound screen when you call shutdown
in the shell (/bin/shutdown.lua
)
It could be argued that /bin/shutdown.lua
should cycle through all available screens and blank/clear them.
I don't think /bin/shutdown.lua
is called because I pressed the button in the gui instead to turn off the computer.
There is no visual indicator if a screen is just blank or off so it's hard to tell that it isn't off. I think it would be better if all screens turned off / went blank when the computer isn't on.
You are correct, pressing the power button on the machine does NOT call /bin/shutdown.lua
-- it would be reasonable to request that a machine visually blanks all screens connected to it when that machine shuts down, considering it does so for one of them.
The default should stay on the currently bound screen(s), as you have to be bound to clear it. Networks can easily be constructed where there are multiple screens on the same network are being driven by different computers.
Hm That makes sense. Maybe add a check to see if there is any computer still turned on in the network before clearing all screens?
I think all the graceful shutdown methods going through /bin/shutdown.lua and allowing the user to determine what they want to do is correct. We should also have disabled code for your case just sitting there to be enabled.
Off-topic, but I'd still like shutdown signal for events too if we are at it so we can safely stop our programs.
calling computer.shutdown
(which /bin/shutdown.lua
does) does send out an event signal, shutdown
If a user is configuring a system with multiple screens, and the gpu cycles between them -- then they should handle the shutdown event and clear each screen manually.
Something like (this is untested, but close):
event.listen("shutdown", function()
local gpu = component.proxy(component.list("gpu", true)())
if not gpu then return end
term.bind(gpu)
for addr in component.list("screen") do
gpu.bind(addr)
term.clear()
end
end)
If you have multiple screens connected to a computer and you turn off the computer then it will only turn off the screen that is currenctly bound to a gpu.
You can control multiple screens with one gpu by rebinding it every time.