Add command to clear screen

This commit is contained in:
Eric Budd 2018-01-31 00:27:02 -05:00
parent e5743e6562
commit 9f9e4149d2
1 changed files with 8 additions and 1 deletions

View File

@ -322,7 +322,7 @@ class Display
end
class Interface
ONE_SHOTS = %w{help topics compose quit freshen reply}
ONE_SHOTS = %w{help topics compose quit freshen reset_display reply}
CMD_MAP = {
't' => 'topics',
'topics' => 'topics',
@ -337,6 +337,8 @@ class Interface
'quit' => 'quit',
'freshen' => 'freshen',
'f' => 'freshen',
'reset' => 'reset_display',
'clear' => 'reset_display',
}
def browsing_handler(line)
@ -352,6 +354,10 @@ class Interface
nil
end
def reset_display
puts `tput reset`.chomp
end
def reply(topic_id = nil)
topic_id ||= @reply_topic
unless topic_id
@ -478,6 +484,7 @@ class Interface
puts 'compose, c - Add a new topic'
puts 'reply #, r # - Reply to a specific topic'
puts 'freshen, f - Reload to get any new messages'
puts 'reset, clear - Fix screen in case of text corruption'
puts
end