gotty

package module
v0.0.0-...-cd52737 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 4, 2012 License: BSD-2-Clause-Views Imports: 10 Imported by: 76

README

Gotty is a library written in Go that determines and reads termcap database
files to produce an interface for interacting with the capabilities of a
terminal.
See the godoc documentation or the source code for more information about
function usage.

Documentation

Overview

Gotty is a Go-package for reading and parsing the terminfo database

Index

Constants

This section is empty.

Variables

View Source
var BoolAttr = [...]string{
	"auto_left_margin", "bw",
	"auto_right_margin", "am",
	"no_esc_ctlc", "xsb",
	"ceol_standout_glitch", "xhp",
	"eat_newline_glitch", "xenl",
	"erase_overstrike", "eo",
	"generic_type", "gn",
	"hard_copy", "hc",
	"has_meta_key", "km",
	"has_status_line", "hs",
	"insert_null_glitch", "in",
	"memory_above", "da",
	"memory_below", "db",
	"move_insert_mode", "mir",
	"move_standout_mode", "msgr",
	"over_strike", "os",
	"status_line_esc_ok", "eslok",
	"dest_tabs_magic_smso", "xt",
	"tilde_glitch", "hz",
	"transparent_underline", "ul",
	"xon_xoff", "nxon",
	"needs_xon_xoff", "nxon",
	"prtr_silent", "mc5i",
	"hard_cursor", "chts",
	"non_rev_rmcup", "nrrmc",
	"no_pad_char", "npc",
	"non_dest_scroll_region", "ndscr",
	"can_change", "ccc",
	"back_color_erase", "bce",
	"hue_lightness_saturation", "hls",
	"col_addr_glitch", "xhpa",
	"cr_cancels_micro_mode", "crxm",
	"has_print_wheel", "daisy",
	"row_addr_glitch", "xvpa",
	"semi_auto_right_margin", "sam",
	"cpi_changes_res", "cpix",
	"lpi_changes_res", "lpix",
	"backspaces_with_bs", "",
	"crt_no_scrolling", "",
	"no_correctly_working_cr", "",
	"gnu_has_meta_key", "",
	"linefeed_is_newline", "",
	"has_hardware_tabs", "",
	"return_does_clr_eol", "",
}

Boolean capabilities

View Source
var NumAttr = [...]string{
	"columns", "cols",
	"init_tabs", "it",
	"lines", "lines",
	"lines_of_memory", "lm",
	"magic_cookie_glitch", "xmc",
	"padding_baud_rate", "pb",
	"virtual_terminal", "vt",
	"width_status_line", "wsl",
	"num_labels", "nlab",
	"label_height", "lh",
	"label_width", "lw",
	"max_attributes", "ma",
	"maximum_windows", "wnum",
	"max_colors", "colors",
	"max_pairs", "pairs",
	"no_color_video", "ncv",
	"buffer_capacity", "bufsz",
	"dot_vert_spacing", "spinv",
	"dot_horz_spacing", "spinh",
	"max_micro_address", "maddr",
	"max_micro_jump", "mjump",
	"micro_col_size", "mcs",
	"micro_line_size", "mls",
	"number_of_pins", "npins",
	"output_res_char", "orc",
	"output_res_line", "orl",
	"output_res_horz_inch", "orhi",
	"output_res_vert_inch", "orvi",
	"print_rate", "cps",
	"wide_char_size", "widcs",
	"buttons", "btns",
	"bit_image_entwining", "bitwin",
	"bit_image_type", "bitype",
	"magic_cookie_glitch_ul", "",
	"carriage_return_delay", "",
	"new_line_delay", "",
	"backspace_delay", "",
	"horizontal_tab_delay", "",
	"number_of_function_keys", "",
}

Numerical capabilities

View Source
var StrAttr = [...]string{}/* 828 elements not displayed */

String capabilities

Functions

func GetTermcapName

func GetTermcapName(name string) string

A utility function that finds and returns the termcap equivalent of a variable name.

Types

type TermInfo

type TermInfo struct {

	// The various names of the TermInfo file.
	Names []string
	// contains filtered or unexported fields
}

func OpenTermInfo

func OpenTermInfo(termName string) (*TermInfo, error)

Open a terminfo file by the name given and construct a TermInfo object. If something went wrong reading the terminfo database file, an error is returned.

func OpenTermInfoEnv

func OpenTermInfoEnv() (*TermInfo, error)

Open a terminfo file from the environment variable containing the current terminal name and construct a TermInfo object. If something went wrong reading the terminfo database file, an error is returned.

func (*TermInfo) GetAttribute

func (term *TermInfo) GetAttribute(attr string) (stacker, error)

Return an attribute by the name attr provided. If none can be found, an error is returned.

func (*TermInfo) GetAttributeName

func (term *TermInfo) GetAttributeName(name string) (stacker, error)

Return an attribute by the name attr provided. If none can be found, an error is returned. A name is first converted to its termcap value.

func (*TermInfo) Parse

func (term *TermInfo) Parse(attr string, params ...interface{}) (string, error)

Parses the attribute that is received with name attr and parameters params.

func (*TermInfo) ParseName

func (term *TermInfo) ParseName(attr string, params ...interface{}) (string, error)

Parses the attribute that is received with name attr and parameters params. Only works on full name of a capability that is given, which it uses to search for the termcap name.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL