term

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2014 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Consts for Get/SetConsoleMode function
	// see http://msdn.microsoft.com/en-us/library/windows/desktop/ms683167(v=vs.85).aspx
	ENABLE_ECHO_INPUT      = 0x0004
	ENABLE_INSERT_MODE     = 0x0020
	ENABLE_LINE_INPUT      = 0x0002
	ENABLE_MOUSE_INPUT     = 0x0010
	ENABLE_PROCESSED_INPUT = 0x0001
	ENABLE_QUICK_EDIT_MODE = 0x0040
	ENABLE_WINDOW_INPUT    = 0x0008
	// If parameter is a screen buffer handle, additional values
	ENABLE_PROCESSED_OUTPUT   = 0x0001
	ENABLE_WRAP_AT_EOL_OUTPUT = 0x0002
)

Variables

This section is empty.

Functions

func GetConsoleMode added in v1.4.0

func GetConsoleMode(fileDesc uintptr) (uint32, error)

func IsTerminal

func IsTerminal(fd uintptr) bool

IsTerminal returns true if the given file descriptor is a terminal.

func RestoreTerminal

func RestoreTerminal(fd uintptr, state *State) error

Restore restores the terminal connected to the given file descriptor to a previous state.

func SetConsoleMode added in v1.4.0

func SetConsoleMode(fileDesc uintptr, mode uint32) error

func SetWinsize

func SetWinsize(fd uintptr, ws *Winsize) error

Types

type CONSOLE_SCREEN_BUFFER_INFO added in v1.4.0

type CONSOLE_SCREEN_BUFFER_INFO struct {
	// contains filtered or unexported fields
}

types for calling GetConsoleScreenBufferInfo see http://msdn.microsoft.com/en-us/library/windows/desktop/ms682093(v=vs.85).aspx

func GetConsoleScreenBufferInfo added in v1.4.0

func GetConsoleScreenBufferInfo(fileDesc uintptr) (*CONSOLE_SCREEN_BUFFER_INFO, error)

type COORD added in v1.4.0

type COORD struct {
	X SHORT
	Y SHORT
}

types for calling GetConsoleScreenBufferInfo see http://msdn.microsoft.com/en-us/library/windows/desktop/ms682093(v=vs.85).aspx

type SHORT added in v1.4.0

type SHORT int16

types for calling GetConsoleScreenBufferInfo see http://msdn.microsoft.com/en-us/library/windows/desktop/ms682093(v=vs.85).aspx

type SMALL_RECT added in v1.4.0

type SMALL_RECT struct {
	Left   SHORT
	Top    SHORT
	Right  SHORT
	Bottom SHORT
}

types for calling GetConsoleScreenBufferInfo see http://msdn.microsoft.com/en-us/library/windows/desktop/ms682093(v=vs.85).aspx

type State

type State struct {
	// contains filtered or unexported fields
}

func MakeRaw added in v1.4.0

func MakeRaw(fd uintptr) (*State, error)

MakeRaw puts the terminal connected to the given file descriptor into raw mode and returns the previous state of the terminal so that it can be restored.

func SaveState

func SaveState(fd uintptr) (*State, error)

func SetRawTerminal

func SetRawTerminal(fd uintptr) (*State, error)

type WORD added in v1.4.0

type WORD uint16

types for calling GetConsoleScreenBufferInfo see http://msdn.microsoft.com/en-us/library/windows/desktop/ms682093(v=vs.85).aspx

type Winsize

type Winsize struct {
	Height uint16
	Width  uint16
	// contains filtered or unexported fields
}

func GetWinsize

func GetWinsize(fd uintptr) (*Winsize, error)

Jump to

Keyboard shortcuts

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