A man who could not accept his ex-partner was seeing someone else carried out his threat to come to her home armed with a knife, a court heard.