The woman had gone into the room at Cresswell Hill, Dumfries and saw the man crouching beside a settee and despite the surprise grabbed at his top.
But in court on Monday, fiscal depute Alison Herald said that he managed to squirm free and left the house pursued by the woman.
As the man made off, the woman’s husband who had been out with their dog and was returning home, heard her shouts and they quickly both got into their car and set off after him.
However, the man ran off across gardens and they phoned the police.
William Drennan, of Cresswell Wynd, Dumfries, was later traced by police and appeared before the court from custody.
He admitted being found in the house on December 23 in circumstances from which it might reasonably be inferred he intended to commit a theft.
He also admitted being found in a garden at Westpark Avenue in the town in similar circumstances the previous day and two days earlier stealing a necklace at another house in the town.
Solicitor David Finnie admitted that Drennan had a lengthy record of previous convictions, but these had tailed off in recent years and he had not come to the attention of the police in the past five months following his release from prison.
He was aware of the stupidity of his actions in the run up to Christmas but he had doubled the medication he had been taking and got himself into a state.
Drennan this week was jailed for two months.