SessionRecorder
ConsoleMonster.Sessions
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
- Method SessionRecorder.Start
Methods
public void AddMarker(string label) #Adds a chapter without printing it to the terminal.
Parameters
- label string
public void CapturePowerShellOutput(string text) #Writes PowerShell host output into an explicitly selected in-process recording.
Parameters
- text string
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
Returns
stringpublic void Resize(int width, int height) #Resizes the child terminal and records the new dimensions.
Parameters
- width int
- height int
public void SendInput(string input) #Forwards UTF-8 input without recording it. Applications control password echo through the PTY.
Parameters
- input string
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
- output System.Action<string>? = null
Returns
SessionRecorderpublic 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
Inherited Methods
Properties
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 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.