Language:
كتاب الصلاة
8  
Prayers (Salat)
(14)
Chapter: If a person offered Salat (prayer) in a dress with marks and looked at those marks during the Salat
(14)
باب إِذَا صَلَّى فِي ثَوْبٍ لَهُ أَعْلاَمٌ وَنَظَرَ إِلَى عَلَمِهَا
Sahih al-Bukhari 373

Narrated `Aisha:

the Prophet (ﷺ) prayed in a Khamisa (a square garment) having marks. During the prayer, he looked at its marks. So when he finished the prayer he said, "Take this Khamisa of mine to Abu Jahm and get me his Inbijaniya (a woolen garment without marks) as it (the Khamisa) has diverted my attention from the prayer."

Narrated `Aisha:

The Prophet (ﷺ) said, 'I was looking at its (Khamisa's) marks during the prayers and I was afraid that it may put me in trial (by taking away my attention).

حَدَّثَنَا أَحْمَدُ بْنُ يُونُسَ، قَالَ حَدَّثَنَا إِبْرَاهِيمُ بْنُ سَعْدٍ، قَالَ حَدَّثَنَا ابْنُ شِهَابٍ، عَنْ عُرْوَةَ، عَنْ عَائِشَةَ، أَنَّ النَّبِيَّ صلى الله عليه وسلم صَلَّى فِي خَمِيصَةٍ لَهَا أَعْلاَمٌ، فَنَظَرَ إِلَى أَعْلاَمِهَا نَظْرَةً، فَلَمَّا انْصَرَفَ قَالَ ‏"‏ اذْهَبُوا بِخَمِيصَتِي هَذِهِ إِلَى أَبِي جَهْمٍ وَائْتُونِي بِأَنْبِجَانِيَّةِ أَبِي جَهْمٍ، فَإِنَّهَا أَلْهَتْنِي آنِفًا عَنْ صَلاَتِي ‏"‏‏.‏ وَقَالَ هِشَامُ بْنُ عُرْوَةَ عَنْ أَبِيهِ عَنْ عَائِشَةَ قَالَ النَّبِيُّ صلى الله عليه وسلم ‏"‏ كُنْتُ أَنْظُرُ إِلَى عَلَمِهَا وَأَنَا فِي الصَّلاَةِ فَأَخَافُ أَنْ تَفْتِنَنِي ‏"‏‏.‏
Reference : Sahih al-Bukhari 373
In-book reference : Book 8, Hadith 25
USC-MSA web (English) reference : Vol. 1, Book 8, Hadith 369
  (deprecated numbering scheme)