File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed
Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ def iterm2?
5353 system ( "convert -density 130 #{ pdf_file } #{ png_file } >/dev/null 2>&1" )
5454 if File . exist? ( png_file )
5555 width = ( cols * 0.75 ) . to_i
56- if system ( "viu -w #{ width } #{ png_file } >/dev/null 2>&1" )
56+ if system ( "viu -w #{ width } #{ png_file } " ) == true
5757 # Clean up
5858 tmp_file . unlink
5959 File . unlink ( pdf_file )
Original file line number Diff line number Diff line change 1818load "#{ DATA_DIR } /lib/stringformat.rb"
1919load "#{ DATA_DIR } /lib/sayings.rb"
2020
21+ # Check terminal size
22+ cols = `tput cols` . to_i
23+ lines = `tput lines` . to_i
24+ if cols < 135 || lines < 40
25+ puts "Terminal must be at least 135 columns x 40 rows. Current: #{ cols } x#{ lines } " . red
26+ exit 1
27+ end
28+
2129def print_header ( header )
2230 puts ""
2331 figlet = RubyFiglet ::Figlet . new ( header , 'standard' )
You can’t perform that action at this time.
0 commit comments