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

18 lines
486 B
Ruby

class Pry
class Command
class 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 Pry::Helpers::Platform.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
end
end