We used to greet the Messenger of Allah ﷺ with the salam while he was praying, and he would return our greeting. But when we returned from our journey to the Negus, we greeted him and he did not return our greeting. He said, "Prayer demands one's full attention."
حدثنا محمد بن عبد الله بن نمير حدثنا ابن فضيل عن الأعمش عن إبراهيم عن علقمة
كنا نسلم على رسول الله ﷺ وهو في الصلاة فيرد علينا فلما رجعنا من عند النجاشي سلمنا عليه فلم يرد علينا وقال إن في الصلاة لشغلا
Bukhari narrated it in the chapter on actions during prayer, section on what is forbidden of speech during prayer, hadith no. 1199, and Muslim narrated it in the chapter on mosques, section on the prohibition of speaking during prayer and the abrogation of what had earlier permitted it, hadith no. 538, both of them from Ibn Numayr through this route.