Paul Cameron was found armed with a stick striking a gas pipe in a cupboard at property in Dalkeith, Midlothian, last August. He yelled at police: "I'll fight you all. I've cut the gas and I'll blow you up and set fire to you all."
Officers had arrived after Cameron had assaulted Karen Wilson with the martial arts stick.
The 31 year-old was back in the dock yesterday after previously admitting to charges of assault, culpable and reckless conduct and breach of the peace.
Judge Lord Malcolm jailed him for four years and nine months at the High Court in Glasgow.
He also ordered that Cameron be supervised for a further six years on his release.
The judge told him: "The potential consequences of your deliberate conduct could have been catastrophic. It is plain that you are a very dangerous person."