Ibn Umar reported that the Messenger of Allah ﷺ used to combine these two prayers while traveling, meaning Maghrib and Isha.
أن رسول الله ﷺ كان يجمع بين هاتين الصلاتين في السفر يعني المغرب والعشاء.
Bukhari narrated it in the chapter on shortening the prayer (1110), from Ishaq, he said, Abdul-Samad bin Abdul-Warith narrated to us, Harb narrated to us, Yahya narrated to us, he said, Hafs bin Ubaydullah bin Anas narrated to me that Anas narrated it to him, and he mentioned it.