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! While you're at it, check out some resources Treehouse students have shared here.
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 trialRichard Stringfellow
6,883 Pointsclear screen
How do you clear the screen when in the ruby console?
14 Answers
Tahseen Malik
16,770 PointsThere are two ways to clear a screen. You could type in 'clear' then press enter or press the command key cmd + letter 'L' on the keyboard; if using the mac. I guess on windows you can replace command key with control key on the keyboard.
Nicholas Pourmoradi
1,910 PointsThis actually requires two steps if you're in irb.
If you're using workspaces on a Mac, type 'exit' to leave irb, and then type 'clear' to clear the screen.
Kelley Fischer
806 PointsThis works on Windows as well. Thank you.
Russell Christensen
4,264 PointsThis action will cause you to lose all the work in irb.
Autumn Williams
949 PointsOMG! Took me forever to find this answer! Thank you!!!!
Ahmed Abbouh
17,034 Pointshi, if you are on Windows, inside IRB you should type system('cls') like this:
irb(main): 007:0>system('cls')
Richard Stringfellow
6,883 PointsYes, that's it! Thank you. In the ruby console (irb), on the Mac, ctrl+l (control + lower case L) clears the screen. The "clear" command will clear screen in Workspaces, but not in the ruby console.
Ken Alger
Treehouse TeacherI use the "clear" command.
Konrad Pilch
2,435 PointsIt doesnt work but ctr + l yes
kabir k
Courses Plus Student 18,036 PointsTo clear the screen in the Treehouse workspaces irb, type
(for Mac)
ctrl + L
OR
system('clear')
(for Windows)
ctrl + L
Anthony c
20,907 PointsI'm still having trouble clearing once irb is open
command + l is not working on my macbook
Alan Fidelino
12,846 PointsI want to keep all the items I am working on in workspaces while in irb, but the clear command does not work. If I quit irb I go back to the default and relaunch irb, my previous work got erased. Hope somebody can help on this one as I think this was not covered on the video.
Alex Lowe
15,147 PointsI tried to look it up and it seems like that's not something that can be done in Windows. It only works on Linux and Mac.
anthony crowell
Courses Plus Student 10,953 PointsI know this is a really old question but if anyone looks. On windows system 'cls' works.
Konrad Pilch
2,435 PointsIts actually ctrl + L
CMD + l doesnt work.
cp88
5,039 PointsEDITED: Typing "clear" doesn't work in the irb section of the console.
I'm using Windows and ctrl and "L" does work, thank you!
Tahseen Malik
16,770 PointsOn the mac you can also type 'quite' or 'exit' Try those.
Amy Kang
17,188 PointsHow do I clear screen in Treehouse workspaces irb? ctrl+L and clear do not work.
Noah Yasskin
23,947 PointsOn windows, the only command that has worked for me is
system('cls')
irb(main):091:0> system('cls')
Noah Yasskin
23,947 PointsNoah Yasskin
23,947 PointsOn windows, in the Interactive Ruby command terminal, the only command that has worked for me is
system('cls')
for example, type:
irb(main):091:0> system('cls')
Ctrl + L does not seem to work.
Thomas Tilton-Heylin
12,098 PointsThomas Tilton-Heylin
12,098 Points(control + l) on mac....