Abdullah bin Masud reported,

We used to greet the Prophet ﷺ with the salam while he was praying, and he would return our greeting. But when we returned from our journey to the Negus and greeted him, he did not respond. We said, "Messenger of Allah, we used to greet you and you would return our greeting."He replied, "In the prayer there is occupation enough."I said to Ibrahim, "What do you do?"He answered, "I return the greeting silently within myself."

Bukhari 3875

Sahih

حدثنا يحيى بن حماد حدثنا أبو عوانة عن سليمان عن إبراهيم عن علقمة

عن عبد الله رضي الله عنه قال

كنا نسلم على النبي ﷺ وهو يصلي فيرد علينا فلما رجعنا من عند النجاشي سلمنا عليه فلم يرد علينا فقلنا يا رسول الله إنا كنا نسلم عليك فترد علينا قال إن في الصلاة شغلا فقلت لإبراهيم كيف تصنع أنت قال أرد في نفسي

البخاري 3875صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Virtues of the Ansar
Chapter
Emigration to Abyssinia
Numbering
Darussalam 3875
Bukhari 3875