Initial patterm project
This commit is contained in:
30
internal/vt/ghostty_nocgo.go
Normal file
30
internal/vt/ghostty_nocgo.go
Normal file
@@ -0,0 +1,30 @@
|
||||
//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) 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) 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)
|
||||
Reference in New Issue
Block a user