Day two of the second Test at Newlands started badly for the Proteas, but they pushed on resolutely to gain an 11-run lead by lunch.
It was a tricky first session for the Proteas. Pakistan picked up where they left off after dismissing Aiden Markram for 78 on the final ball of day one, and climbed into the Proteas before lunch.
Hashim Amla survived less than two overs at the start of play before he was trapped leg before by Mohammad Abbas off 64 balls (4×4) with the score on 126.
Theunis de Bruyn and Proteas skipper Faf du Plessis took their time to get a feel for the pitch and the Pakistani pacemen, adding 24 runs for the fourth wicket in just over 10 overs, before De Bruyn fell with the score on 149, caught superbly in the gully by Babar Azam off the bowling of Shaheen Afridi for 13 off 32 balls.
With his place on the Proteas lineup under fire from many quarters, De Bruyn will be ruing the loose slash that cost him his wicket, especially with a host of promising young (and older) batters around South Africa, particularly Zubayr Hamza, all pushing for a chance to be the 100th man to earn a Proteas cap.
This left Proteas skipper Faf du Plessis (33) at the crease as he nudged the Proteas into the lead. He was well-supported by Temba Bavuma, who managed to contribute a handy 15.
Du Plessis and Temba Bavuma took their time to overtake Pakistan shortly before the lunch break, trotting to a 39-run partnership.
The Proteas ended the session on 188-4 with a lead of 11 runs.