33 lines
1.5 KiB
Go
33 lines
1.5 KiB
Go
//go:build nocgo
|
|
|
|
// This file provides a stub GhosttyEmulator for `go vet` / `go build`
|
|
// invocations that pass the `nocgo` build tag, so the rest of the Go code can
|
|
// be checked without `libghostty-vt` being installed. The stub fails at
|
|
// construction time — there is no functional emulator in `nocgo` builds.
|
|
|
|
package vt
|
|
|
|
import "errors"
|
|
|
|
type GhosttyEmulator struct{}
|
|
|
|
func NewGhosttyEmulator(cols, rows uint16) (*GhosttyEmulator, error) {
|
|
return nil, errors.New("vt: built with -tags nocgo; libghostty-vt is unavailable")
|
|
}
|
|
|
|
func (e *GhosttyEmulator) Write(p []byte) (int, error) { return 0, errStub }
|
|
func (e *GhosttyEmulator) Resize(cols, rows uint16) error { return errStub }
|
|
func (e *GhosttyEmulator) Size() (uint16, uint16) { return 0, 0 }
|
|
func (e *GhosttyEmulator) PlainText() (string, error) { return "", errStub }
|
|
func (e *GhosttyEmulator) ScreenText() (string, error) { return "", errStub }
|
|
func (e *GhosttyEmulator) SerializeVT() ([]byte, error) { return nil, errStub }
|
|
func (e *GhosttyEmulator) StyledScreenVT() ([]byte, error) { return nil, errStub }
|
|
func (e *GhosttyEmulator) Cursor() (CursorState, error) { return CursorState{}, errStub }
|
|
func (e *GhosttyEmulator) ActiveScreen() (Screen, error) { return 0, errStub }
|
|
func (e *GhosttyEmulator) OnWritePTY(fn func([]byte)) {}
|
|
func (e *GhosttyEmulator) Close() error { return nil }
|
|
|
|
var errStub = errors.New("vt: built with -tags nocgo")
|
|
|
|
var _ Emulator = (*GhosttyEmulator)(nil)
|