Skip to content

Make terminal output recording optional - #2593

Open
DharmendraChoudhary67 wants to merge 1 commit into
warp-tech:mainfrom
juspay:record-terminal-output
Open

DharmendraChoudhary67 wants to merge 1 commit into
warp-tech:mainfrom
juspay:record-terminal-output

Conversation

@DharmendraChoudhary67

Copy link
Copy Markdown

Description

Fixes #2567.

Adds a record_terminal_output parameter (default on) next to record_scp and record_desktop_keyboard_input. When it is off, TerminalRecorder keeps the Input stream and PTY resizes and drops Output/Error, so a command that prints a large file cannot fill up the recording storage. A single gate in TerminalRecorder::write covers native SSH, web SSH and Kubernetes exec. The SSH command detector still receives the output, so the Shell command log entries are unchanged.

Measured: pulling a 54 MB file through one SSH session gives a 72 MB recording with the option on and a 194-byte recording (the typed bytes) with it off.

Playback: such recordings carry an input_only entry in index.ndjson (additive; existing players ignore unknown entry types). The terminal player renders the keystrokes for them (Enter breaks the line, backspace erases, other control bytes in caret notation), in replay and live, shows an "input only" notice, and replays from the start instead of relying on seek anchors. The recorder no longer writes snapshots without output, since the screen is never fed.

Changes:

  • migration m00086_record_terminal_output, entity field, admin parameters API
  • gate and index marker in warpgate-core/src/recordings/terminal.rs
  • switch under Session recordings in Parameters.svelte, regenerated admin OpenAPI schema
  • TerminalRecordingPlayer.svelte: keystroke rendering for input-only recordings
  • tests: unit test for the marker shape, e2e test test_terminal_recording_input_only

Notes:

  • The parameter is read when a channel starts (like record_desktop_keyboard_input), so sessions already running keep their mode.
  • Only target output is bounded; data sent by the client (large pastes, uploads over stdin) is still recorded.
  • Rendering keystrokes makes text typed at no-echo prompts (for example sudo passwords) visible in the player; those bytes were always in the Input stream.
  • Live view stays a tail of the file, so admins do not see target output live while the option is off. That is the open question from Option to record only user input in terminal session recordings (drop target output) #2567; happy to follow up either way.

AI Usage

Choose the level of AI involvement for this PR.

  • Fully vibe coded
  • AI-designed, AI-coded, manually checked
  • Human-designed, AI-coded
  • Human-designed, human-coded (includes AI autocompletions and boilerplate gen)

This is not to block AI contributions but rather to speed up PR review (saves time on trying to deduce the logic behind AI hallucinations).

Adds a `record_terminal_output` parameter (default on) next to
`record_scp` and `record_desktop_keyboard_input`. When it is off,
`TerminalRecorder` keeps the Input stream and PTY resizes and drops
Output/Error for native SSH, web SSH and Kubernetes exec, so a command
that prints a large file can no longer fill up the recording storage.
The SSH command detector still receives the output, so the
"Shell command" log entries are unchanged.

Such recordings carry an `input_only` entry in index.ndjson. The terminal
player renders the keystrokes for them (Enter breaks the line, backspace
erases, other control bytes in caret notation), in replay and live, and
replays from the start instead of relying on blank seek anchors, which
the recorder no longer writes without output.
@DharmendraChoudhary67 DharmendraChoudhary67 changed the title fixed #2567 - make terminal output recording optional Make terminal output recording optional Sep 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Option to record only user input in terminal session recordings (drop target output)

1 participant