humour that makes unpleasant things, such as death, seem funny
Usage notes: The gallows are a wooden frame used in the past for killing criminals by hanging them from a rope tied around their neck.
Many of the patients I worked with knew they were dying. There was a lot of gallows humour.