Remix.run Logo
fpoling 4 days ago

This has the same purpose as caffeinate command on Mac and will prevent the system from suspend while a command is running. This is useful with tmux or long compilations or tests or whatever.

On Linux I rather prefer to configure my laptop to never suspend when connected to a power supply. For me the compilations and tests heavily drain battery and should not be run typically on battery.

But it turned on Mac Apple really wants to suspend and configuring the same behavior is somewhat non-trivial. So in past when I used Mac i often had a terminal window running

caffeinate -i sleep infinity

to prevent any suspend until I hit Ctrl-C there.

mrtesthah 3 days ago | parent [-]

The underlying API is called Power Management Assertions.