Properly handle terminal messages.