gallows humor
Short definition from Wiktionary
Noun
- A form of comedy that still manages to be humorous in the face of, and in response to, a tragic or hopeless situation.
We haven’t written up gallows humor yet: Simple and Standard meanings, examples and a quiz.