Repository navigation
feat(keep-awake): a PC doesn't sleep while a chat is working - #393
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A new core feature,
keep-awake, on by default like the out-of-memory guard and switchable off in Settings. It runs in the runtime and insand -p.turnOpen/turnClose), and lets go 60 s after the last one closes. The display may still turn off and lock.SetThreadExecutionState(ES_CONTINUOUS | ES_SYSTEM_REQUIRED)throughbun:ffi; Windows drops it when the process exits.caffeinate -i cat; Linux:systemd-inhibit --what=sleep --mode=block … cat.catreads a pipe from sand, so letting go, sand exiting or sand crashing all close it and end the block.systemd-inhibit, the inhibitor fails, other OS) it does nothing and writes one line to the server log.Reference: pingdotgg/t3code#34128.
Checked on Windows: in a sandbox,
sand -prunning a shellsleep 5took the block (the thread's state read 0x80000001 while held, 0x80000000 after). The inhibitor's release and failure paths were exercised with stand-in commands. macOS and Linux weren't run.