Module: WindowBlessing::XtermOutput::SetState

Included in:
WindowBlessing::XtermOutput
Defined in:
lib/window_blessing/xterm_output.rb

Instance Method Summary collapse

Instance Method Details

#disable_alternate_screenObject



76
77
78
79
# File 'lib/window_blessing/xterm_output.rb', line 76

def disable_alternate_screen
  out "\e[?47l"
  out "\e8"
end

#disable_focus_eventsObject



66
# File 'lib/window_blessing/xterm_output.rb', line 66

def disable_focus_events; out "\e[?1004l" end

#disable_mouseObject



63
# File 'lib/window_blessing/xterm_output.rb', line 63

def disable_mouse; out "\e[?1003l"; end

#disable_utf8Object



69
# File 'lib/window_blessing/xterm_output.rb', line 69

def disable_utf8; out "\e%@" end

#echo_offObject

TODO: find out what stty raw -echo sends to xterm INTERNAL NOTE: out “e[12h” # should turn off echo according to doc, but didn’t work stackoverflow.com/questions/174933/how-to-get-a-single-character-without-pressing-enter



84
# File 'lib/window_blessing/xterm_output.rb', line 84

def echo_off; system "stty raw -echo"; end

#echo_onObject

INTERNAL NOTE: out “e[12l” # should turn echo back on



87
# File 'lib/window_blessing/xterm_output.rb', line 87

def echo_on; system "stty -raw echo"; end

#enable_alternate_screenObject



71
72
73
74
# File 'lib/window_blessing/xterm_output.rb', line 71

def enable_alternate_screen
  out "\e7"
  out "\e[?47h"
end

#enable_focus_eventsObject



65
# File 'lib/window_blessing/xterm_output.rb', line 65

def enable_focus_events; out "\e[?1004h" end

#enable_mouseObject



62
# File 'lib/window_blessing/xterm_output.rb', line 62

def enable_mouse; out "\e[?1003h"; end

#enable_utf8Object



68
# File 'lib/window_blessing/xterm_output.rb', line 68

def enable_utf8; out "\e%G" end

#hide_cursorObject



60
# File 'lib/window_blessing/xterm_output.rb', line 60

def hide_cursor; out "\e[?25l"; end

#show_cursorObject



59
# File 'lib/window_blessing/xterm_output.rb', line 59

def show_cursor; out "\e[?25h"; end