1Bring a large pot of heavily salted water to a boil. Meanwhile, prepare an ice water bath by filling a large bowl halfway with ice and water. Remove the stems from the green beans. Peel, halve, and thinly slice the onion.
2Place the beans in the boiling water and cook until crisp-tender, about 3 minutes. Drain and immediately place in the ice water bath until cooled. Drain and set aside.
3Heat the oil in a large frying pan over medium heat until shimmering. Add the sliced onion and cook until caramelized and golden, about 20 minutes. Season with salt and pepper.
4Add the reserved green beans, vinegar, and sugar. Cook, stirring, until the sugar has dissolved, about 2 minutes. Stir in the parsley, taste, and season with additional salt and pepper as needed.