see that, then implore Allah, perform the prayer, and give charity …” — the ḥadīth.
If the prayer concludes before the eclipse has cleared, one continues to remember Allah and supplicate Him until it does clear and does not repeat the prayer. Should the eclipse clear while he is still praying, he finishes the prayer quickly and does not break it, in view of the divine command, “and do not nullify your deeds.” Thus the prayer is confined to the time of the eclipse, as indicated by his words, “until it clears,” and, “until what afflicts you is removed.”
Shaykh al-Islām Ibn Taymiyyah said: “The duration of an eclipse sometimes lengthens and at other times shortens according to the portion that is obscured; it may be total, or half, or a third. When the eclipse is severe, the prayer is prolonged so that one recites Sūrah al-Baqarah or the like in the first rakʿah, and after the second bowing he recites something shorter than that. Authentic ḥadīths from the Prophet, peace and blessings be upon him, confirm what we have mentioned. He also prescribed shortening the prayer once the cause has disappeared, and likewise when it is known that the eclipse will not last long. If it lessens before the prayer has begun, he should still commence it and keep it brief; this is the position of the majority of scholars, for the ruling was instituted for a cause that has now ceased. If it clears completely before the prayer is initiated, he does not pray …” End quote.