Module: WindowBlessing::XtermOutput::SetState
- Included in:
- WindowBlessing::XtermOutput
- Defined in:
- lib/window_blessing/xterm_output.rb
Instance Method Summary collapse
- #disable_alternate_screen ⇒ Object
- #disable_focus_events ⇒ Object
- #disable_mouse ⇒ Object
- #disable_utf8 ⇒ Object
-
#echo_off ⇒ Object
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.
-
#echo_on ⇒ Object
INTERNAL NOTE: out “e[12l” # should turn echo back on.
- #enable_alternate_screen ⇒ Object
- #enable_focus_events ⇒ Object
- #enable_mouse ⇒ Object
- #enable_utf8 ⇒ Object
- #hide_cursor ⇒ Object
- #show_cursor ⇒ Object
Instance Method Details
#disable_alternate_screen ⇒ Object
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_events ⇒ Object
66 |
# File 'lib/window_blessing/xterm_output.rb', line 66 def disable_focus_events; out "\e[?1004l" end |
#disable_mouse ⇒ Object
63 |
# File 'lib/window_blessing/xterm_output.rb', line 63 def disable_mouse; out "\e[?1003l"; end |
#disable_utf8 ⇒ Object
69 |
# File 'lib/window_blessing/xterm_output.rb', line 69 def disable_utf8; out "\e%@" end |
#echo_off ⇒ Object
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_on ⇒ Object
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_screen ⇒ Object
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_events ⇒ Object
65 |
# File 'lib/window_blessing/xterm_output.rb', line 65 def enable_focus_events; out "\e[?1004h" end |
#enable_mouse ⇒ Object
62 |
# File 'lib/window_blessing/xterm_output.rb', line 62 def enable_mouse; out "\e[?1003h"; end |
#enable_utf8 ⇒ Object
68 |
# File 'lib/window_blessing/xterm_output.rb', line 68 def enable_utf8; out "\e%G" end |
#hide_cursor ⇒ Object
60 |
# File 'lib/window_blessing/xterm_output.rb', line 60 def hide_cursor; out "\e[?25l"; end |
#show_cursor ⇒ Object
59 |
# File 'lib/window_blessing/xterm_output.rb', line 59 def show_cursor; out "\e[?25h"; end |