gallows humor
gallows' humor {n. phr.}
Bitter joke(s) that make fun of a very serious matter, e.g. death, imprisonment, etc.
When the criminal was led to the electric chair on Monday morning, he said, "Nice way to start the week, eh?"
Categories:
Source: A Dictionary of American Idioms