Leeds Crown Court heard Zaheed Latif has been in custody since being arrested over the incident at Asda, Old Lane, Beeston, in May last year.
Latif and the woman had been in a relationship and they have a child together.
The relationship ended because of Latif's behaviour towards the victim and he was made the subject of restraining order prevent him from contacting her.
Resident claims Leeds pub music is 'like a bad night in Benidorm’ amid plans to extend opening hours
Bus services refuse to go through parts of east Leeds due to ‘antisocial behaviour and vandalism’
17 pictures you'll only understand if you're from Leeds
Couple attacked over city-centre cigarette request, Leeds Crown Court told
Former law student jailed for "wrestling woman" in street robbery
On May 6 last year he was seen hiding in her garden and police were called.
On May 11 he turned up at her home, banged on her door and shouted abuse from the garden.
Four days later he turned up again at her home and demanded to be allowed in.
The 24-year-old defendant followed the woman as she took her daughter for a walk to the Asda store on May 18.
The victim saw Latif in an alleyway but she ignored him.
He followed her and approached her as she waited in the queue to enter the store.
A security guard approached as he formed the view that the woman was being harassed.
Latif said to the security guard: "I will give you a slap. What have you come outside for?"
The court heard Latif's eyes were "bulging" and he appeared to be on drugs.
Latif then shoved the woman and said: "I will kill you one day."
As officers took hold of him he grabbed of one of their body-worn cameras, causing it to fall to the floor and crack.
Latif, of Sefton Terrace, Beeston, pleaded guilty to putting a person in fear of violence, common assault, obstructing a police constable and threatening behaviour.
Michael Walsh, mitigating, said Latif had been in custody for more than 300 days since being arrested.
Mr Walsh said Latif pleaded guilty to the offences at an early stage and was sorry for his offending.
He was given a sentence of 42 weeks, meaning he will be released from prison due to the length of time has has already spent on remand.