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]

Chongchong Wang
Chongchong Wang
10,305 Points

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

Valentin Famelart
Valentin Famelart
19,190 Points

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.