also pajamahs, 1800, pai jamahs "loose trousers tied at the waist," worn by Muslims in India and adopted by Europeans there, especially for nightwear, from Hindi pajama, probably from Persian paejamah, literally "leg clothing," from pae "leg" (from PIE root *ped- "foot") + jamah "clothing, garment." The modern U.S. spelling is by 1845; British spelling tends toward pyjamas.
Others are reading
<a href="https://www.etymonline.com/word/PJs">Etymology of PJs by etymonline</a>
Harper, D. (n.d.). Etymology of PJs. Online Etymology Dictionary. Retrieved $(datetime), from https://www.etymonline.com/word/PJs