Therefore, one must be careful not to leave a book open and depart, even with other books, and even with printed Gemaras and poskim, for it is a disgrace. Rather, he should either close them, meaning they should not be open, or cover them with a cloth. Aside from this, it is detrimental to memory (Shach, see there). And such is the custom to be careful in this. And it seems to me specifically when one goes out to the street. But one who enters from room to room, or even to the courtyard or the street, not for a lengthy period of time – there is no concern in this (and so wrote the Ya'avetz, see there).
ולכן יש ליזהר שלא להניח ספר פתוח ולצאת, אפילו בשארי ספרים, ואפילו גמרות ופוסקים הנדפסים, דבזיון הוא. אלא או יסגירם, כלומר שלא יהיו פתוחים, או יכסה עליהם בגד. ולבד זה קשה לשכחה (ש"ך עיין שם). וכן המנהג ליזהר בזה. ונראה לי דווקא כשיצא לרחוב. אבל הנכנס מחדר לחדר, או אפילו לחצר ולרחוב, שלא על אריכת הזמן – אין חשש בזה (וכן כתב הי"ש, עיין שם).