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:
| 46 | // - Mouse and bracketed paste are not wired; terminfo/xterm queries |
| 47 | // are not attempted because vt(1) may not support them. |
| 48 | type 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 | |
| 61 | func NewDevTty() (Tty, error) { // tcell signature |
| 62 | return newPlan9TTY() |
nothing calls this directly
no outgoing calls
no test coverage detected