It depends on the OS.
On a Linux/Mac, you have hardware process protection so it’s hard to wedge the whole OS. You can get their process number and then kill the process with a keyboard command.
On Windows, the Task Manager tends to provide a similar function. It’s been less reliable to me, but your mileage may vary.
Latest Answers