ˈgallows ˌhumour British English,
gallows humor American English noun [uncountable] humour which makes very unpleasant or dangerous things seem funny
[TahlilGaran] Dictionary of Contemporary English ▲
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?" [TahlilGaran] English Idioms Dictionary ▲