From 9f9e4149d28ea3c71b86af6b4d9bf1fd8e7f2c32 Mon Sep 17 00:00:00 2001 From: Eric Budd Date: Wed, 31 Jan 2018 00:27:02 -0500 Subject: [PATCH] Add command to clear screen --- iris.rb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/iris.rb b/iris.rb index bc9a81a..0bccf83 100755 --- a/iris.rb +++ b/iris.rb @@ -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