Leeds Crown Court heard that while he was in the loft, 47-year-old Andrew Gillies sent the woman a text message telling her to leave the house as he didn't want to hurt her.
Prosecutor, Louise Pryke said Gillies went into the woman's bedroom and pulled back her bed sheets.
He held one of the two knives he had to woman's stomach while verbally insulting her.
The woman scratched Gillies to get away from him and suffered a small cut during the struggle.
Gillies then called police, saying he would kill her if he was not arrested.
Miss Pryke said Gillies and the woman had been in a relationship for seven years, but it deteriorated and the woman had asked him to move out in December last year.
She said Gillies constantly made threats to kill himself, the victim and members of her family.
The woman spent the day with her family on December 8 and Gillies sent her texts telling her not to go home because he would kill her if she did.
He then called the emergency services, saying: "If you don't send the police in five minutes I will kill someone."
Gillies also said: "If the police do not show up and take me away, she will be dead in half an hour."
Gillies, who has no previous convictions, later told police he had a hazy recollection of the incident because he had been drinking.
Gillies, of St Elmo Grove, Leeds 9, admitted making threats to kill and common assault.
Gillies was handed an 18-month prison sentence, suspended for two years.
He must complete the building better relationships programme and do 20-days of rehabilitation activity.
Judge Simon Batiste told Gillies: "It was in the breakdown of your relationship that you completely lost control.
"You were at her house and you told her not to go back. When she died you threatened her with two knives. You threatened to kill her."