1
0
Fork 0
mirror of https://github.com/pry/pry.git synced 2022-11-09 12:35:05 -05:00
pry--pry/lib/pry/commands/clear_screen.rb
Robert b6d3e9e22e
Add a new command, "clear-screen", that clears the content of the (#1723)
screen Pry is running in regardless of platform (Windows or UNIX-like).
2017-12-26 12:53:48 +01:00

14 lines
389 B
Ruby

class Pry::Command::ClearScreen < Pry::ClassCommand
match 'clear-screen'
group 'Input and Output'
description 'Clear the contents of the screen/window Pry is running in.'
def process
if windows?
_pry_.config.system.call(_pry_.output, 'cls', _pry_)
else
_pry_.config.system.call(_pry_.output, 'clear', _pry_)
end
end
Pry::Commands.add_command(self)
end