251227.15 · 33bb0b2e0d834ec7362da86f6c71de99ce4b146b
chore: move Tty to sub-subpackage (including WindowSize)
We also added compatibility aliases. The purpose of this is to break potential circular dependencies so that we can use symbols for TTYs and the WindowSize in the vt emulator and mock packages.
We want to then be able to add tests in the main tcell package, which can use these -- this move breaks the circular dependency.
reading declarations
Changes to tty/tty_wasm.go. All files
@@ -0,0 +1,21 @@+//go:build wasm || js+// +build wasm js++package tty++import "errors"++// NewDevTty obtains a default tty from the console or TTY (e.g. /dev/tty) for the process.+func NewDevTty() (Tty, error) {+ return nil, errors.New("No tty device on wasm")+}++// NewDevTtyFromDev obtains a tty from the given device path. Not supported on Windows.+func NewDevTtyFromDev(dev string) (Tty, error) {+ return nil, errors.New("No tty device on wasm")+}++// NewStdIoTty obtains a tty from stdin and stdout.+func NewStdIoTty() (Tty, error) {+ return nil, errors.New("No tty device on wasm")+}