Feature Request: Add terminal session recording to Start-Transcript (capture TUI applications, export to video)

Abierto
#28,353 3 comentarios 2 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
22/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
csharp, powershell
Área
backend, cli

Línea de trabajo

Read the submitted RFC, PowerShell-RFC#421, and discussion #28296 to understand the proposed host-level capture approach and WG-Interactive review request. The issue describes ConPTY/PTY capture, asciicast v3 output, and optional video export, but gives no implementation files or tests to start from. Done would require an RFC decision and a scoped experimental implementation.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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/tty and 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-Transcript

Produces:

  • session01.txt — the existing text transcript (unchanged)
  • session01.cast — time-stamped terminal stream (asciicast v3); always written as source of truth; plays with asciinema play
  • session01.webm — rendered video (GIF built-in; WebM/MP4 via ffmpeg when 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: PowerShell/PowerShell-RFC#421
  • Discussion: #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

Lenguaje dominante
C#
Estrellas
56.1k
Forks
8.5k
Merge medio
12 h 33 min
PR fusionados (30 d)
73

Preparar el entorno

Abrir en Codespaces

Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de PowerShell/PowerShell

Todos los issues de PowerShell/PowerShell

Issues similares

Más issues de C#

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.