Adding minimal support for Plan9#810
Conversation
|
@gdamore the PR is ready for review. |
gdamore
left a comment
There was a problem hiding this comment.
In general this looks pretty good, and thank you for doing this. I cannot attest to it actually working, so I hope you've done that.
I have a reservation about the console_stub.go change, please see my comments there to double check if that's really what you meant to do. If it is, I'd like to get a better explanation behind it.
(Basically "console" is a Windows thing in tcell, so I am surprised if any non windows platforms want anything besides the stub... it seems like you're using the tty support modified for plan 9, which looks reasonable based on your comments.)
|
@gdamore thank you for the review. i have reversed the |
|
@gdamore |
|
No. I will merge this as soon as I am back on my personal laptop.
• Garrett
…On Aug 19, 2025 at 8:16 PM -0700, Dan Mushkevych ***@***.***>, wrote:
mushkevych left a comment (gdamore/tcell#810)
@gdamore
I was wondering if there are any pending concerns preventing from merging this PR.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|




plan9: add minimal Plan 9 backend for tcell (raw
/dev/cons, resize via/dev/wctl, terminfo screen)Summary
This PR introduces limited Plan 9 support for
tcellbehind build tags, enabling tcell-based applications (e.g., tview/cview) to compile and run on Plan 9 undervt(1)(VT100 emulator). The implementation uses Plan 9’s native console and window-control files to provide raw input, output, and resize notifications, while reusing tcell’s existing terminfo screen path.Scope: No behavioral changes on non-Plan9 platforms. Public API is unchanged except for Plan 9–specific implementations.
Motivation
Upstream currently documents Plan 9 as unsupported. This PR provides a clean, low-risk baseline that:
//go:build plan9,Technical Overview
New/updated files (Plan 9 only)
tty_plan9.goOpens
/dev/cons(read/write) for console I/O.Toggles raw mode by writing
"rawon"/"rawoff"to/dev/consctl.Listens for resize events by blocking on
/dev/wctl.Implements
Ttyinterface, lifecycle (Start/Stop/Close) with idempotency:stopChand re-opens/dev/wctlon resume.WindowSize()honorsTCELL_LINES/TCELL_COLSandLINES/COLUMNS; defaults to 80×24:tscreen_plan9.goPlan 9 constructor:
Plan 9 initializer:
Ensures
t.ttyis set duringScreen.Init():Note: We do not redefine
screen.go::NewScreen().charset_plan9.gogetCharset()returning"UTF-8"(Plan 9 is built around Unicode, using UTF-8 system-wide - the encoding invented at Bell Labs by Ken Thompson and Rob Pike while they, alongside other Plan 9 pioneers, were developing the system).Architecture & Data Flow
/dev/consin raw mode → tcell input decoder (UTF-8)./dev/cons, interpreted byvt(1)(VT100)./dev/wctl; on change, invokeNotifyResizecallback;WindowSize()returns rows/cols via env or default.Compatibility & Risk
//go:build plan9.Known Limitations (Plan 9)
vt(1)(TERM=vt100), expect monochrome (VT100 typically lacks ANSI color). If another terminal on Plan 9 provides ANSI/xterm capabilities andTERMis set accordingly, terminfo can enable more features.vt(1)does not emit xterm mouse/paste sequences; adding support would require a terminal that does, plus glue in the Plan 9 TTY path.LINES/COLUMNS(orTCELL_LINES/TCELL_COLS) with a default 80×24. We do not compute rows/cols from pixel geometry;/dev/wctlresize is handled as an event trigger only.GOOS=plan9) in CI (if added). No runtime tests on Plan 9 yet.Testing
Docker one-shot build