pty

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2023 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PTYRun

func PTYRun(f PTYRunFunc, termCmd ...string) error

PTYRun starts a pseudo terminal and runs a function on its pty.

func TakeScreenshot

func TakeScreenshot(termName string, termProvider TermProviderFunc, drawerName string, drawFuncProvider DrawFuncProvider, imgBytes []byte, cellBounds image.Rectangle, rsz term.Resizer) (image.Image, error)

TakeScreenshot ...

Types

type DrawFunc

type DrawFunc = func(tm *term.Terminal, dr term.Drawer, rsz term.Resizer, cpw, cph uint) (areaOfInterest image.Rectangle, scaleX, scaleY float64, e error)

DrawFunc returns the area that will be screenshot by TakeScreenshotFunc and the scale for unstretching a possibly contained image

func DrawFuncOnlyPicture

func DrawFuncOnlyPicture(img image.Image, cellBounds image.Rectangle) DrawFunc

DrawFuncOnlyPicture ...

type DrawFuncProvider

type DrawFuncProvider = func(img image.Image, cellBounds image.Rectangle) DrawFunc

type PTYRunFunc

type PTYRunFunc = func(pty string, pidTerm uint) error

func TakeScreenshotFunc

func TakeScreenshotFunc(termProvider TermProviderFunc, termChecker term.TermChecker, drawerName string, drawFunc DrawFunc, rsz term.Resizer, imgChan chan<- image.Image) PTYRunFunc

TakeScreenshotFunc displays an image in a pseudo-terminal and captures the displayed version for comparison.

type TermProviderFunc

type TermProviderFunc = func(ttyFile string) (*term.Terminal, error)

Jump to

Keyboard shortcuts

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