Christopher Dalton, 39, brandished the blade at an address in Cedar Close, Ripon, where his former partner and others were terrorised by the knife-wielding thug who was waving the blade around while shouting dire threats, York Crown Court heard.
Prosecutor Rob Galley said that on the night before the incident, Dalton had been sending threatening Facebook messages to a named man who he believed was in a relationship with his ex-partner.
Dalton had messaged him asking to meet up for a fight, telling him: “‘About time we had it out, I’m going to do you with a knife".
The following day, he went to the address in Cedar Close armed with the eight-inch blade.
He jumped off his bike outside the property, then pulled out the knife and shouted: “Come on, let’s have it out".
He then walked up to his former partner, who was outside the property, and pointed the knife at her, before “waving it around in front of her face”.
He then aimed a volley of abuse at the woman and told her: “I’ll ******* kill you.”
Her male friend or partner, who went to her aid, was said to be in “genuine fear for his life”.
As one of the other named men at the scene tried to put him in a “bear hug”, Dalton tried to stab him.
He and three of the other people present managed to restrain Dalton, who was “flinging his arms around, with the knife (pointed) towards them”, said Mr Galley.
Police turned up but Dalton, who was drunk and on drugs, continued swearing and shouting threats.
As he was cuffed and led away by police, he shouted to two of the named males: “You’re ******* dead".
He then turned to his former partner and shouted: “I’ll smash your mum’s house".
He was charged with affray, carrying an offensive weapon and sending threatening messages intending to cause stress or anxiety to the male victim.
Dalton, of Westgate, Ripon, admitted all three offences and appeared for sentence via video link on May 16 after being remanded in custody.
Ismael Uddin, mitigating, said Dalton had been drinking and taking drugs when he sent the threatening Facebook messages the night before the incident on April 18.
He said the “catalyst” for Dalton’s shocking behaviour was that he thought his former partner was in a relationship with this man.
Mr Galley said Dalton had 51 previous convictions for 88 offences dating back more than 20 years, including violence, theft and public disorder.
His “appalling” record also included two previous convictions for carrying an offensive weapon in public, ostensibly golf clubs.
He was recently given a short prison sentence for a series of shop thefts in Ripon.
Judge Nicholas Lavender QC told Dalton: “You intended to cause fear of serious violence and you caused serious fear.
"You were carrying a knife and came close to stabbing someone with it.
“Your offending is so serious that only an immediate custodial sentence can be justified".
Jailing Dalton for two years, Mr Lavender QC said he presented “a danger to others”.
Dalton was also received with a five-year restraining order banning him from contacting the male victim and going within 100 metres of an address in Ripon.