xterminal

package
v1.28.0 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2022 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Overview

Package xterminal provides functions to change termios or console attributes and restore them later on. It supports Unix and Windows.

This does the same thing as x/crypto/ssh/terminal on Linux. On Windows, it sets the same console modes as the terminal package but also sets `ENABLE_VIRTUAL_TERMINAL_INPUT` and `ENABLE_VIRTUAL_TERMINAL_PROCESSING` to allow for VT100 sequences in the console. This is important, otherwise Linux apps (with colors or ncurses) that are run through SSH or wsep get garbled in a Windows console.

More details can be found out about Windows console modes here: https://docs.microsoft.com/en-us/windows/console/setconsolemode

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Restore

func Restore(fd uintptr, state *State) error

Restore terminal back to original state.

Types

type State

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

State differs per-platform.

func MakeOutputRaw

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

MakeOutputRaw does nothing on non-Windows platforms.

Jump to

Keyboard shortcuts

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