virtualterm

package
v0.0.0-...-e081c89 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2024 License: GPL-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package virtualterm provides a virtual terminal and some terminal emulation functions

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PtyState

type PtyState struct {
	LfIncCr bool // if false, \n acts as a \r\n
}

PtyState defines some basic emulation states for the virtual TTY

type Term

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

Term is the display state of the virtual term

func NewTerminal

func NewTerminal(x, y int) *Term

NewTerminal creates a new virtual term

func (*Term) Export

func (t *Term) Export() string

Export returns a character map of the virtual terminal

func (*Term) ExportHtml

func (t *Term) ExportHtml() string

ExportHTML returns a HTML reder of the virtual terminal

func (*Term) GetSize

func (term *Term) GetSize() (int, int, error)

GetSize outputs mirror those from terminal and readline packages

func (*Term) MakeRaw

func (term *Term) MakeRaw() PtyState

MakeRaw sets the virtual TTY to a raw state

func (*Term) Restore

func (term *Term) Restore(state PtyState)

Restore returns the virtual TTY to a previous state

func (*Term) Write

func (term *Term) Write(text []rune)

Write multiple characters to the virtual terminal

Jump to

Keyboard shortcuts

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