module Opal::Terminal::Screen

Overview

Screen control and ANSI terminal escape codes.

Defined in:

opal/terminal/screen.cr

Constant Summary

CLEAR_ALL = "\e[2J"

Clearing

CLEAR_DOWN = "\e[0J"
CLEAR_LINE = "\e[2K"
CLEAR_LINE_LEFT = "\e[1K"
CLEAR_LINE_RIGHT = "\e[0K"
CSI = "\e["
CURSOR_HOME = "\e[H"
DISABLE_MOUSE = "\e[?1006l\e[?1002l\e[?1000l"
ENABLE_MOUSE = "\e[?1000h\e[?1002h\e[?1006h"

Mouse tracking (SGR mode 1006 with button event 1002 and normal tracking 1000)

ENTER_ALT_BUFFER = "\e[?1049h"

Screen buffer controls

ESC = "\e"
EXIT_ALT_BUFFER = "\e[?1049l"
HIDE_CURSOR = "\e[?25l"

Cursor visibility

RESET_FORMAT = "\e[0m"
SHOW_CURSOR = "\e[?25h"

Class Method Summary

Class Method Detail

def self.move_backward(n : Int32 = 1) : String #

Returns an escape code to move the cursor backward n columns.


[View source]
def self.move_down(n : Int32 = 1) : String #

Returns an escape code to move the cursor down n lines.


[View source]
def self.move_forward(n : Int32 = 1) : String #

Returns an escape code to move the cursor forward n columns.


[View source]
def self.move_to(row : Int32, col : Int32) : String #

Returns an escape code to position the cursor at (row, col) (1-indexed).


[View source]
def self.move_up(n : Int32 = 1) : String #

Returns an escape code to move the cursor up n lines.


[View source]
def self.set_title(title : String) : String #

Returns an escape code to set the terminal window title.


[View source]