Skip to content
ConsoleMonster
Class

SessionRecorder

ConsoleMonster.Sessions

Namespace
ConsoleMonster.Sessions
Assembly
ConsoleMonster
Implements
IDisposable
Modifiers
sealed

Records a child terminal to local asciicast v2. Raw input is forwarded but never stored, so password input remains private when applications disable echo. Secret patterns are applied to output before disk writes.

Inheritance

  • object
  • SessionRecorder

Usage

Explore 1 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

Returned or exposed by 1

Methods

public void AddMarker(string label) #

Adds a chapter without printing it to the terminal.

Parameters

label string required
public void CapturePowerShellOutput(string text) #

Writes PowerShell host output into an explicitly selected in-process recording.

Parameters

text string required
public void Dispose() #

Stops and disposes this recorder's transport and files.

public static string MarkerSequence(string label) #

Creates the private OSC chapter control for a child shell to write to its output.

Parameters

label string required

Returns

string
public void Resize(int width, int height) #

Resizes the child terminal and records the new dimensions.

Parameters

width int required
height int required
public void SendInput(string input) #

Forwards UTF-8 input without recording it. Applications control password echo through the PTY.

Parameters

input string required
public static SessionRecorder Start(SessionRecordingOptions options, Action<string>? output = null) #

Starts a recorded child process, or a labelled capture sink for a PowerShell host adapter.

Parameters

options ConsoleMonster.Sessions.SessionRecordingOptions required
output System.Action<string>? = null optional
public void Stop() #

Stops the owned child and finalizes the recording. Does not affect other terminals.

public void WaitForExit(CancellationToken cancellationToken = default) #

Waits for the child, drains its output, and finalizes both local files. Cancellation stops the owned child.

Parameters

cancellationToken System.Threading.CancellationToken = default optional

Properties

public string Path { get; } #

The local cast file.

public string Mode { get; } #

The capture mode, also stored in the cast header and sidecar.

public bool LimitReached { get; } #

Whether capture reached its configured byte cap.

public bool HasExited { get; } #

Whether the child exited or Stop was called.

public int ExitCode { get; private set; } #

Child exit code; available after WaitForExit.

public bool StopRequested { get; } #

Whether the recorded child sent Stop-ConsoleRecording.

public static string StopSequence { get; } #

Private OSC stop control for the recorded child shell.

Events

public event Action<string>? Output #

Live unredacted terminal output, with private recording controls consumed. Subscribers must not persist it.