A court heard then 60-year-old victim suffered a punctured lung and had to spend three days in hospital after being stabbed by Catherine Emery during the terrifying incident on York Road.
Emery carried out the attack on July 5 last year, days after being released from prison for violence.
Andrew Semple, prosecuting, described how Emery had been involved in a number of frightening confrontations before being arrested.
Mr Semple said a resident living on York Road heard a woman shouting loudly to herself at a bus stop.
Emery became aggressive and pulled out a large knife when the man asked her to be quiet.
The man then closed the door of his home and Emery began banging on it. He dialled 999 when Emery tried to smash the window.
He went outside with a walking stick and used it to try to knock the weapon out of her hand.
Emery, 20, of Dufton Approach, Seacroft, then walked off up York Road and stopped a taxi in the middle of the dual carriageway.
She pulled out the weapon and began stabbing the bonnet of the vehicle.
She then walked off and stopped a second taxi which was carrying two passengers. Emery climbed on the bonnet of the vehicle and began scratching at it with the knife.
One passenger then got out and tried to calm her down but she went to attack him and they both fell to the ground.
The second passenger got out to help as they were both struggling on the floor. Emery struck out at him with the weapon and caught him in the chest.
Police arrived and Emery began to attack the police van before she was detained using CS spray.
She pleaded guilty to wounding with intent, affray, possession of a bladed weapon and three offences of criminal damage.
Nicholas De La Poer, mitigating, said Emery had been assessed by doctors and diagnosed as suffering from a mental disorder. He added that she came from a “tragic background”.
Judge James Spencer, QC, ordered that Emery be detained under the Mental Health Act indefinitely so she can receive treatment for her condition.
She will be released only when it is deemed safe to do so.
Judge Spencer said: “It is quite clear from the evidence that I have seen that you are not well.”