Questions coriander

I purchased a coriander plant from the supermarket and have kept it watered and and in the sun (on a windowsill) however it’s begining to wilt quite badly.What am I doing wrong?