Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community!

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

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