MCPcopy
hub / github.com/gdamore/tcell / p9Tty

Struct p9Tty

tty/tty_plan9.go:48–59  ·  view source on GitHub ↗

p9Tty implements tcell.Tty using Plan 9's /dev/cons and /dev/consctl. Raw mode is enabled by writing "rawon" to /dev/consctl while the fd stays open. Resize notifications are read from /dev/wctl: the first read returns geometry, subsequent reads block until the window changes (rio(4)). References:

Source from the content-addressed store, hash-verified

46// - Mouse and bracketed paste are not wired; terminfo/xterm queries
47// are not attempted because vt(1) may not support them.
48type p9Tty struct {
49 cons *os.File // /dev/cons (read+write)
50 consctl *os.File // /dev/consctl (write "rawon"/"rawoff")
51 wctl *os.File // /dev/wctl (resize notifications)
52
53 closed atomic.Bool
54 started bool
55
56 onResize atomic.Value // resize channel
57 wg sync.WaitGroup
58 stopCh chan struct{}
59}
60
61func NewDevTty() (Tty, error) { // tcell signature
62 return newPlan9TTY()

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected