Repository navigation
Description
Summary
Start-Transcript should gain the ability to record the terminal session itself — including full-screen interactive TUI applications — and save it in a replayable, time-stamped format (asciicast v3) optionally rendered as a video file (GIF/WebM/MP4). This is the PowerShell-level equivalent of RHEL's system-wide session recording via tlog/SSSD/PAM, or of asciinema/script(1) — notably, the asciinema CLI itself does not support Windows.
Background
Start-Transcript is documented to capture "all command that the user types and all output that appears on the console", but in practice it only captures what flows through the PowerShell host. TUI applications bypass the pipeline entirely:
- On Windows,
sconfig(Windows Server) opens the console directly (CONIN$/CONOUT$), switches to raw mode, and paints the screen with VT sequences - On Linux,
nmtui(RHEL),vim,htop, etc. open/dev/ttyand use the alternate screen buffer
So a transcript of a session that uses a TUI application is effectively blank for the duration of that application. This was discussed in detail in discussion #28296, where rhubarb-geek-nz confirmed the current behavior is best-effort and noted his console-logger tool proves the technical approach on Windows: a pseudo-console (ConPTY) wrapper can both display and capture interactive programs.
Proposed behavior
Start-Transcript -Path .\audit\session01 -RecordTerminal -RecordingFormat WebM
sconfig # full-screen TUI — fully recorded
# ... interact ...
Stop-TranscriptProduces:
session01.txt— the existing text transcript (unchanged)session01.cast— time-stamped terminal stream (asciicast v3); always written as source of truth; plays withasciinema playsession01.webm— rendered video (GIF built-in; WebM/MP4 viaffmpegwhen available)
New parameters (strictly additive, existing behavior untouched): -RecordTerminal, -RecordingFormat (Asciicast|Gif|WebM|Mp4), -RecordInput (keystroke capture, off by default due to secret-capture risk), -RecordIdleTimeLimit.
Technical approach: host-level capture — the console host attaches native child processes to a ConPTY (Windows) / PTY (Unix) pair, proxies the VT stream to the real terminal, and tees it with timestamps into the recorder. Only the host can do this transparently; a PSGallery module cannot intercept CONIN$/CONOUT$//dev/tty traffic of arbitrary children.
Scenarios
- Audit/compliance: defensible records of privileged interactive administration (sconfig, nmtui, vendor consoles), aligned with the tlog/SSSD precedent and extendable via Group Policy per RFC0041
- Support/incident response: reproduce exactly what was on screen when a failure occurred inside a TUI app
- Training/docs/bug reports: shareable GIF/WebM of a full session including TUI interactions
Status
- An RFC draft has been submitted per the PowerShell RFC process: RFC: Terminal Session Recording in Start-Transcript PowerShell-RFC#421
- Discussion: What should the transcript ideally capture when a TUI application starts in PowerShell? #28296
Per the RFC process, this issue requests the appropriate Working Group (WG-Interactive) to review whether the RFC can proceed toward an experimental implementation.
/cc rhubarb-geek-nz
Activity
237dmitry commentedon Nov 5, 2026
Alternative buffer does not work on
/dev/tty(`e[?1049h,`e[?1049l)soroshsabz commentedon Nov 5, 2026
soroshsabz commentedon Nov 5, 2026
Community module update + proposed engine enhancements that would make this cleanly implementable
A cross-platform community implementation of this request at PowerShell Gallery module scope now exists:
Bsn.HostwithStart-/Stop-/Show-InteractiveTranscript— ConPTY engine (Windows 10 1809+),script(1)(Linux/macOS), asciicast v2 output, RFC 421 parameter semantics (-RecordingFormat,-RecordIdleTimeLimit,-RecordInput,r/ievents). It validates the "nested recorded session" model: everything run inside the recorded session — including full-screen TUI apps — is captured, andStop-InteractiveTranscriptfinalizes it from inside.Building it confirmed precisely where the module ceiling is, and which engine-level APIs would remove it. Proposed on the RFC PR as well (PowerShell/PowerShell-RFC#421 (comment)), summarized here:
Out-Defaultproxy hacks; still cannot see native/TUI children that write to inherited console handles.openptybehind one API) — the single biggest practical win: our 600-line P/Invoke engine plus thescript(1)fallback collapses to ~50 lines, and every terminal-automation module benefits. (Long-standing dotnet/runtime request.)PSHost.EnterNestedTerminal(...)-style: raw console-mode save/restore, VT passthrough, resize forwarding, clean teardown) — this is the "host cooperation" the feature needs; the engine provides plumbing, the gallery provides UX.Start-Transcript— the engine keeps transparent host-level capture (as the RFC specifies), modules implement sinks (asciicast v2, audit/SIEM formats, video renderers). One capture implementation in-box; format innovation in the ecosystem.The architectural boundary is stable across all of these: a module can never retroactively insert a PTY between an already-running shell and its terminal — same reason
asciinema,script(1)andtlogall use entered/hosted sessions. Transparent capture of the current session stays engine-only, which is what the RFC proposes.