TkConsole holds the widget in a subclass o_widget field (always the
authority for size/eof/capability; new 'widget' accessor) and accepts
optional -in/-out constructor channels. New minimal widget-console wiring
::opunk::console::tk::console: a reflected output channel rendering into
the widget (ansi-stripped when punk::ansi is present) plus an input pipe
fed by the <Return> binding or programmatic submit/feed, with <Destroy>
teardown flagging backend eof and closing the feed end - so a channel-
driven repl runs against the widget via 'repl::init -console'. The size
override now reports the widget's ACTUAL character dimensions while mapped
(current pixel size / font metrics - tracks live window resizing); the
requested -width/-height still answer for unmapped widgets, keeping
construction-time behaviour and existing test pins unchanged.
Assisted-by: harness=claude; primary-model=claude-fable-5; api-location=anthropic.com
@ -21,7 +21,7 @@ Modules under the `opunk::*` namespace explore value-based class implementations
- Anchor lifecycle is observable the same way: `::opunk::console::lifecycle_callback` is a command prefix invoked as `{*}$cb created|forgotten <name> {in out}` after `create` anchors / `forget` releases an instance; punk::console registers its handler via `ensure_object_integration` to maintain the G-007 console ownership registry. Empty by default; callback errors propagate to the create/forget caller.
- Method-entry validity guards use `[llength $this] < N` (not `!= N`) so field-adding subclasses keep working.
- Subclassing (`voo::class <Child> -extends ::opunk::Console {...}`): the child inherits public accessors and the field INDEX variables, but not the parent's private `my.*` accessors - a subclass CONSTRUCTOR initialises inherited private fields via the index variables (`variable o_in` then `lset obj $o_in $value` - the sanctioned exception to the avoid-`variable o_<field>` rule, which still applies in method bodies where the parent's public accessor METHODS should be used instead, e.g `[::opunk::Console::in $this]`). Overridden `-virtual` methods are plain `method` declarations in the child; base-class calls dispatch to them via the slot-0 tag.
- G-001 backend subclasses (console/ subfolder): `opunk::console::test` (`::opunk::TestConsole` - deterministic channel-pair test double: fixed size, no probes; the console seam for repl/editbuf characterization), `opunk::console::ssh` (`::opunk::SshConsole` - socket-carried terminal sessions: construction-time capability, chan-eof without probe, size via the ANSI size-query provider over the connection), `opunk::console::tk` (`::opunk::TkConsole` - Tk text widget as terminal: widget path in the in/out slots, size from widget char dims, backend eof marker via `::opunk::console::tk::set_eof`; no Tk package require at load). Tests: `src/tests/modules/opunk/console/testsuites/console/backends.test` (tk case gated behind env `PUNK_TEST_TK=1` - loading Tk into the shared runtests testinterp has event-loop side effects).
- G-001 backend subclasses (console/ subfolder): `opunk::console::test` (`::opunk::TestConsole` - deterministic channel-pair test double: fixed size, no probes; the console seam for repl/editbuf characterization), `opunk::console::ssh` (`::opunk::SshConsole` - socket-carried terminal sessions: construction-time capability, chan-eof without probe, size via the ANSI size-query provider over the connection), `opunk::console::tk` (`::opunk::TkConsole` - Tk text widget as terminal: widget held in a subclass `o_widget` field which always answers size/eof/capability; in/out slots carry the widget path by default or channels via `-in`/`-out`; backend eof marker via `::opunk::console::tk::set_eof`; `::opunk::console::tk::console <widget>` wires a reflected output channel + Return-binding input pipe so a channel-driven repl runs against the widget; no Tk package require at load - only the wiring proc requires Tk). Tests: `src/tests/modules/opunk/console/testsuites/console/backends.test` (tk case gated behind env `PUNK_TEST_TK=1` - loading Tk into the shared runtests testinterp has event-loop side effects) and the repl-integration suite `src/tests/modules/punk/repl/testsuites/repl/consolebackends.test` (child-process drivers; tk case self-gates on Tk availability in the child).
- Module filenames use the `-999999.0a1.0.tm` magic suffix with `<modulename>-buildversion.txt` per parent conventions.
- `opunk::console` (with its dependency `voo`) is included in bootsupport via `src/bootsupport/modules/include_modules.config` for eventual boot/repl-startup console objects; after releasing a new version, rebuild with `make.tcl modules` then refresh the snapshot with `make.tcl bootsupport`.
#0.2.0 - size now reports the widget's ACTUAL character dimensions when mapped (current pixel size / font metrics - tracks live window resizing); the requested -width/-height remain the answer for unmapped widgets (construction-time/tests unchanged)
#0.2.0 - G-001: TkConsole gains a subclass o_widget field (widget is always the authority for size/eof/capability; new 'widget' accessor) and optional -in/-out constructor channels; new minimal widget-console wiring ::opunk::console::tk::console (reflected output channel rendering into the widget, input pipe fed by the <Return> binding or programmatic submit/feed, <Destroy> teardown) so a channel-driven repl can be launched against the widget via repl::init -console. Default construction (widget path in in/out slots) unchanged.