1.8 KiB
scriptlib/utils/pwsh
Powershell helper scripts for punkshell.
consolemode_server_async.ps1 (canonical - G-106)
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=1in 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.