Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Ruby Ruby Collections Ruby Arrays Accessing Items in Arrays

John Bamberg
John Bamberg
9,774 Points

How does he clear his screen? lol

How does he clear is screen in irb?

Press the Ctrl+lower case L buttons at the same time if you are using Mac OSX or Linux.

I have used the (Ctrl+L) with success on my Macbook to clear the irb screen.

Others have reported that on Windows, that 'cls' works. I haven't tried this on Windows, so I can not confirm that this last method works.

4 Answers

Mark Halverson
Mark Halverson
5,749 Points

Control + l (lowercase L) will clear the screen in IRB Workspaces (Windows or Mac)

Also In mac, for screen clear for terminal or IRB is [CMD + k]

Just to complete the statement, CTRL + L is a terminal command that empties the buffer. This shortcut works in all terminal emulators that matches Unix behavior (as a reminder MacOS is based on Unix) . There is no (for now) such thing in Windows other than issuing the cls command. Which, because it is a command, is added to the command history. (There are alternatives to Windows' lack of features CMD, if you would prefer having Unix functionnalities)

While on windows, it usually just scrolls the terminal, on Unix, the buffer will be emptied, meaning that what you're seeing on the terminal will not be visible if you scroll back up.

Chongchong Wang
Chongchong Wang
10,305 Points

for clear the screen, in Mac, use command + r