Raw mode on twapi-less windows runtimes made dependable and quiet: lazy
singleton server (tsv-shared per process, spawn no longer at module
load), parent-pid self-reaping (no orphan pwsh), the 20s
keepalive-without-pinger and the first-message listener kill (reader
Close disposing the pipe stream) both fixed, disableraw served on
no-inputmode runtimes (8.6 path), enable confirmed via live tcl9
-inputmode before return, script resolution env -> argv0 -> module-dir
-> embedded copy (pwd fallback gone; kits need no scriptlib on disk).
PUNK_PS_CONSOLEMODE_DEBUG=1 for diagnostics both sides.
scriptlib/utils/pwsh reconciled: canonical consolemode_server_async.ps1
rewritten (protocol enableraw|disableraw|ping|exit, parent-pid watch,
posh-git MIT attribution for the C# snippet), five experiment variants
retired (consolemode_server.ps1, *_async1.ps1, *_async.2ps1,
consolemode.ps1, consolemode_enableraw.ps1), README labels the folder.
New console suite psfallback.test pins the embedded-copy/file sync and
the resolution chain. punk::repl stale comment fix (no behaviour
change). Verified per the recipe recorded in the goal detail file:
hidden-console selftests on suite tclsh90spr + zipfs kit tclsh90sprzip
(25s-idle survival, stop/respawn, zero orphans), live make.tcl-shell and
bare-repl sessions driven by injected keystrokes (console mode
0x1E7<->0x1E1 read externally), embedded-resolution forced run, console
testsuite 76/76. G-106 acceptance met - achieved flip recorded in the
detail file; archive move follows in the next commit.
Assisted-by: harness=claude; primary-model=claude-fable-5; api-location=anthropic.com
The powershell console-mode fallback server: a persistent named-pipe server that
punk::console launches when twapi is absent on windows, to flip the console's line/echo
input flags for raw mode. This file is the canonical maintained copy; the module
src/modules/punk/console-999999.0a1.0.tm carries an embedded copy
(punk::console::system::ps_consolemode_script_embedded) as the last-resort resolution
for kits and unusual cwds. Keep the two in sync - the console testsuite
src/tests/modules/punk/console/testsuites/console/psfallback.test fails when they
diverge.
Key facts (details in the script header and goals/archive/G-106-powershell-consolemode-fallback.md):
Delivered to powershell via -c <script text> with <punkshell_*> placeholders
substituted (no script file needed at run time; not subject to ExecutionPolicy).
Semicolons after each command are required by that delivery convention.
Protocol: one line per named-pipe connection - enableraw | disableraw | ping | exit.
The server watches the owning tcl process's pid and exits with it (orphan prevention).
Quiet by default; PUNK_PS_CONSOLEMODE_DEBUG=1 in the launching tcl process's
environment enables diagnostics on both sides.
The NativeConsoleMethods C# snippet derives from posh-git (MIT - attribution carried in
the script).
Superseded experiment variants (consolemode_server.ps1, consolemode_server_async1.ps1,
consolemode_server_async.2ps1, consolemode.ps1 - the posh-git original this derives from -
and the one-shot consolemode_enableraw.ps1) were retired 2026-07-22 as part of G-106; see
VCS history to recover them.
echotest.ps1
Standalone one-line scratch script (write-host "test") - not part of the console-mode
fallback machinery.