pty

package
v0.0.0-...-e3a9e5c Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2021 License: BSD-3-Clause, LGPL-2.1, MIT, + 1 more Imports: 6 Imported by: 0

Documentation

Overview

Package pty provides functions for working with Unix terminals.

SPDX-License-Identifier: MIT

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Getsize

func Getsize(t *os.File) (rows, cols uint16, err error)

Getsize returns the number of rows (lines) and cols (positions in each line) in terminal t.

func IsForeground

func IsForeground(f *os.File) bool

func IsTerminal

func IsTerminal(f *os.File) bool

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

func Open

func Open() (pty, tty *os.File, err error)

Opens a pty and its corresponding tty.

func Ptsname

func Ptsname(f *os.File) (string, error)

func Resizer

func Resizer(parent, child *os.File)

func Restore

func Restore(f *os.File, state *State) error

Restore sets a terminal back to a previously saved state

func Setsize

func Setsize(f *os.File, rows, cols uint16) error

func Unlockpt

func Unlockpt(f *os.File) error

Types

type State

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

State is the terminos struct

func MakeRaw

func MakeRaw(f *os.File) (*State, error)

MakeRaw puts a tty into raw mode and returns the previous state

func Makefilelike

func Makefilelike(f *os.File) (*State, error)

Jump to

Keyboard shortcuts

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