AN ex-boyfriend threatened to break down his former partner's door at night and "slice" the man he believed to be in her home, York Crown Court heard.

Keiron Lesley Parker, 25, had earlier sent the woman a picture of the kitchen knife he had with him when he banged on her windows at 4.30am on February 14, said Thomas Parsons-Munn, prosecuting.

There was no man in the flat.

The woman and her child were sleeping alone in the flat when Parker's banging woke her up.

He sent her a Facebook message that he would "slice the man he believed to be inside, said Mr Parsons-Munn.

He also sent a message that he would "take the door off, I am not bothered."

The woman contacted a friend who called the police.

"She was in fear that had the defendant gone into the address, he may have harmed her with the knife," said the prosecution barrister.

"She was alarmed for her own safety and that of her son."

At 1am Parker had sent her a Snapchat picture of a 20cm knife.

When police responded to the 999 call they found Parker in the communal area of the block of flats where the woman lived.

On him was a knife identical to the one in the photo he had sent her.

Parker, of Fenwick Street, Clementhorpe, pleaded guilty to carrying a knife in public, sending offensive messages and a public order offence.

He was jailed for five months and made subject to a two-year restraining order banning him from contacting the woman.

His barrister Eddison Flint said Parker had behaved out of character.

He had never intended to cause the woman any distress.

"The day before, this defendant had found himself in an absolute tornado of chaos that led to the basically idiotic behaviour," he said.

Parker had been drinking before the incident and had argued with the woman via text messages.

"It was a very acrimonious split," the defence barrister claimed about the end of the couple's relationship.

The defendant knows now the relationship between them is done, absolutely done.

"He understands now he has to move on."

"Lots of people have acrimonious splits," the Recorder of York, Judge Sean Morris told Parker.

"They don't go round in the dead of night armed with a knife banging on windows and doors, terrorising their partners and threatening to "slice" somebody up."

Mr Parsons-Munn said the woman no longer felt safe in her home as Parker knew where she lived.

Mr Flint said Parker was not working at the time of the offence which had led to him drinking.

He normally installed swimming pools all over the country.