Write implements io.Writer by sending data to the terminal via TermWrite.
(p []byte)
| 38 | |
| 39 | // Write implements io.Writer by sending data to the terminal via TermWrite. |
| 40 | func (tr *TermRef) Write(p []byte) (n int, err error) { |
| 41 | if tr.VDomRef == nil || !tr.VDomRef.HasCurrent.Load() { |
| 42 | return 0, fmt.Errorf("TermRef not current") |
| 43 | } |
| 44 | err = TermWrite(tr.VDomRef, string(p)) |
| 45 | if err != nil { |
| 46 | return 0, err |
| 47 | } |
| 48 | return len(p), nil |
| 49 | } |
| 50 | |
| 51 | // TermSize returns the current terminal size, or nil if not yet set. |
| 52 | func (tr *TermRef) TermSize() *vdom.VDomTermSize { |
nothing calls this directly
no test coverage detected