diff --git a/lib/cheat.rb b/lib/cheat.rb index 3c6abc2..416fa99 100644 --- a/lib/cheat.rb +++ b/lib/cheat.rb @@ -94,6 +94,8 @@ def show(sheet_yaml) run_pager puts sheet.first + ':' puts ' ' + sheet.last.gsub("\r",'').gsub("\n", "\n ").wrap + rescue Errno::EPIPE + # do nothing rescue puts "That didn't work. Maybe try `$ cheat cheat' for help?" # Fix Emacs ruby-mode highlighting bug: `" end @@ -174,6 +176,8 @@ def run_pager unless Kernel.fork # Child process STDOUT.reopen(write) STDERR.reopen(write) + read.close + write.close return end