How Do You Clear The IRB Console?

Viewed 64853

How do you clear the IRB console screen?

21 Answers

On Mac OS X or Linux you can use Ctrl + L to clear the IRB screen.

On *nix boxes

`clear`

on Windows

system 'cls' # works
`cls` # does not work

on OSX

system 'clear' # works
`clear` # does not work

The backtick operator captures the output of the command and returns it

s = `cls`
puts s

would work better, I guess.

Related