module SpecSelectorUtil::Terminal

The Terminal module contains methods concerned with terminal display function.

Public Instance Methods

clear_frame() click to toggle source
# File lib/spec_selector/terminal.rb, line 7
def clear_frame
  system("printf '\e[H'")
  system("printf '\e[3J'")
  system("printf '\e[0J'")
end
close_alt_buffer() click to toggle source
# File lib/spec_selector/terminal.rb, line 29
def close_alt_buffer
  system('tput rmcup')
end
hide_cursor() click to toggle source
# File lib/spec_selector/terminal.rb, line 13
def hide_cursor
  system("printf '\e[?25l'")
end
open_alt_buffer() click to toggle source
# File lib/spec_selector/terminal.rb, line 25
def open_alt_buffer
  system('tput smcup')
end
position_cursor(row, col) click to toggle source
# File lib/spec_selector/terminal.rb, line 41
def position_cursor(row, col)
  system("printf '\e[#{row};#{col}H'")
end
reset_cursor() click to toggle source
# File lib/spec_selector/terminal.rb, line 33
def reset_cursor
  system("printf '\e[H'")
end
reveal_cursor() click to toggle source
# File lib/spec_selector/terminal.rb, line 17
def reveal_cursor
  system("printf '\e[?25h'")
end
term_height() click to toggle source
# File lib/spec_selector/terminal.rb, line 21
def term_height
  $stdout.winsize[0]
end
term_width() click to toggle source
# File lib/spec_selector/terminal.rb, line 37
def term_width
  $stdout.winsize[1]
end