-
Notifications
You must be signed in to change notification settings - Fork 8.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Option to prevent sleep if task is running #16376
Comments
I... don't hate this. But knowing when to do this would be tricky. We wouldn't necessarily want to always prevent sleep if the Terminal is running - we'd probably want to only do that if there's a child process running. That of course gets into weird edge cases - just running Terminal doesn't currently track the tree of processes. We'll need to do that for #6549 though |
To give a real world use case scenario, I hit this when building https://github.com/microsoft/CsWinRT locally, which takes like half an hour. Started |
This may be more suitable as a tool outside of Terminal, FWIW. I'm imagining something like macOS' |
that's actually really clever |
Would it perhaps make sense to have it just built-in into Terminal, so you can opt-in on a per-command basis? |
Eh, honestly, in the name of trying to keep things as minimal as possible, probably not. However, there is PowerToys.Awake, but I cannot for the life of me figure out how to get the CLI to work @crutkas help me out |
@zadjii-msft i believe we can close this out as PT would be the team for this |
Thanks @crutkas! @Sergio0694, if PowerToys Awake (CLI) doesn't quite fit your needs... we can all work together to make sure something does. 😄 |
Description of the new feature/enhancement
On my machine, I have set the sleep time to 15 minutes. Sometimes (eg. when running long builds) I would just step away from it and let it work, but then come back with it being on standby and with the work just paused, which is pretty annoying. It would be nice if Terminal had an option to make it automatically prevent the machine going to sleep if there's some operation running in any tabs. This is pretty common for other applications/websites as well (eg. if you have Spotify playing music in Edge, your computer won't go to sleep).
Note
Tried searching for a similar issue and couldn't find one, so hopefully this is not a duplicate.
Proposed technical implementation details
PowerToys is already doing this in their "awake" feature, we could probably just do the same here?
Ie.
SetThreadExecutionState
?The text was updated successfully, but these errors were encountered: