8

Possible Duplicate:
How can I clear the terminal in Ruby?

How to clear the terminal screen in ruby?

puts "hello, what's your name?"
input = gets.chomp
<<clearscreen>>
puts "nice to meet you, #{input}"
braX
  • 10,905
  • 5
  • 18
  • 32
Mr. Demetrius Michael
  • 2,186
  • 5
  • 26
  • 37

1 Answers1

12

Not sure what you're asking exactly, but there are different ways to clear irb / terminal in this post: How Do You Clear The IRB Console?

One that is intersting is

In order to clear the screen just do a

puts "\e[H\e[2J"

Community
  • 1
  • 1
Brett Sanders
  • 803
  • 8
  • 21