Abu Hurairah reported,

The Messenger of Allah ﷺ said, "Each of you remains in prayer as long as he is waiting for it, and the angels keep praying for each of you as long as he is in the mosque, saying, 'Allah, forgive him. Allah, have mercy on him,' so long as he does not break his ablution."A man from Hadramawt asked, "What does breaking ablution mean, Abu Hurayrah?"He replied, "Passing wind, silently or audibly."

Tirmidhi 330

Sahih

حدثنا محمود بن غيلان حدثنا عبد الرزاق أخبرنا معمر عن همام بن منبه

عن أبي هريرة قال

قال رسول الله ﷺ لا يزال أحدكم في صلاة ما دام ينتظرها ولا تزال الملائكة تصلي على أحدكم ما دام في المسجد اللهم اغفر له اللهم ارحمه ما لم يحدث فقال رجل من حضرموت وما الحدث يا أبا هريرة قال فساء أو ضراط

الترمذي 330صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami Tirmidhi
Book
Prayer
Chapter
Sitting in the masjid and waiting for prayer is a virtue
Numbering
Darussalam 330
Tirmidhi 330