如何清除IRB控制台?
时间:2020-03-06 14:33:20 来源:igfitidea点击:
如何清除IRB控制台屏幕?
解决方案
在Mac OS X或者Linux上,我们可以使用Ctrl + L清除IRB屏幕。
把它丢进%userprofile%\。irbrc
里面就可以了
def cls system('cls') end
从IRB在Windows上清除屏幕。
在* nix盒子上
`clear`
在Windows上
system 'cls' # works `cls` # does not work
在OSX上
system 'clear' # works `clear` # does not work
反引号运算符捕获命令的输出并将其返回
s = `cls` puts s
我猜会更好。