<分区>
Possible Duplicate:
How can I clear the terminal in Ruby?
如何在 ruby 中清除终端屏幕?
puts "hello, what's your name?"
input = gets.chomp
<<clearscreen>>
puts "nice to meet you, #{input}"
<分区>
Possible Duplicate:
How can I clear the terminal in Ruby?
如何在 ruby 中清除终端屏幕?
puts "hello, what's your name?"
input = gets.chomp
<<clearscreen>>
puts "nice to meet you, #{input}"
最佳答案
不确定您到底在问什么,但是在这篇文章中有不同的方法可以清除 irb/terminal:How Do You Clear The IRB Console?
一个有趣的是
为了清除屏幕只需做一个
puts "\e[H\e[2J"
关于 ruby 清屏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10261359/