Handling OS Signals

Learn to handle OS signals in CLI applications using the Context package.

When writing CLI applications, there are occasions when a developer wants to handle OS signals. The most common example is a user trying to exit a program, usually through a keyboard shortcut.

In these cases, we may want to do some file cleanup before exiting or cancel a call we made to a remote system.

In this lesson, we’ll talk about how we can capture and respond to these events to make our applications more robust.

Get hands-on with 1200+ tech skills courses.