feat: add --type, --delay, --no-enter flags to send command#5
Conversation
Enables simulating realistic typing interactions on PTY sessions: - --type: sends input character by character instead of all at once - --delay <ms>: configurable delay between characters (default 50ms), ideal for asciinema recordings - --no-enter: omits the trailing newline, useful for prompts that read one char at a time Refactors SendInput to accept a SendOptions struct (TypeMode, TypeDelay, NoEnter, Redacted) and adds 6 unit tests + 2 integration tests covering type mode, delay timing, no-enter, combined usage, and redaction in type mode.
StructLint — All checks passed58 rules validated against
|
There was a problem hiding this comment.
Core Changes
- Introduced new CLI flags
--type,--delay, and--no-enterfor thesendandsend-redactedcommands, allowing for character-by-character input, configurable delays, and optional trailing newlines. - Refactored the
services.ProcessManager.SendInputmethod to accept aSendOptionsstruct, encapsulating the new input delivery parameters (type mode, delay, no-enter, and redaction). - Added new fields to the
domain.DaemonRequestto transport these options from the client to the daemon. - Implemented new unit and integration tests to cover the functionality of the new
sendoptions.
Concerns
No critical concerns regarding security, performance, or logic flaws were identified. The changes are well-contained and tested.
Verdict
Approve: The changes introduce valuable new functionality, are well-implemented, and include comprehensive tests. No issues were found that would prevent merging.
Code review performed by GEMINI - gemini-2.5-flash.
There was a problem hiding this comment.
Core Changes
- Introduced new CLI flags
--type,--delay, and--no-enterfor thesendandsend-redactedcommands, allowing for simulated typing, configurable delays between characters, and omitting the trailing newline. - Refactored the
services.ProcessManager.SendInputfunction to accept aSendOptionsstruct, encapsulating the new input delivery parameters (TypeMode,TypeDelay,NoEnter,Redacted). - Added comprehensive unit and integration tests to validate the functionality of the new input sending modes and their combinations.
Verdict
Approve: The changes introduce new features with a clean implementation, are well-tested, and do not appear to introduce any regressions or critical issues.
Code review performed by GEMINI - gemini-2.5-flash.
Adds a per-process vt10x VT100 emulator that runs alongside the existing ring buffer. Raw PTY bytes are fed to the emulator in captureOutput so it always reflects the current rendered screen state. New command: yoink snapshot <id|alias> (alias: snap) - Renders the current terminal frame as clean plain text - Works correctly for TUI apps (htop, vim, Claude, etc.) where yoink log would return raw cursor-movement escape garbage - Works on both running and finished processes (last rendered frame) - Trims trailing whitespace per line and trailing blank rows 7 unit tests + 3 integration tests including top as a real TUI process, the canonical proof that snapshot > log for full-screen applications.
There was a problem hiding this comment.
Core Changes
- Introduced a new
snapshotcommand (andsnapalias) to render the current VT100 screen of a process as plain text, correctly handling TUI applications. - Enhanced the
sendcommand with new flags:--typefor character-by-character input simulation,--delayto control typing speed, and--no-enterto omit the trailing newline. - Refactored the internal
SendInputfunction to accept aSendOptionsstruct, encapsulating input delivery parameters.
Concerns
No critical concerns regarding security, performance, or logic flaws were identified. The internal API changes are handled within the scope of this pull request.
Verdict
Approve: The changes introduce valuable new features, are well-implemented, and include comprehensive unit and integration tests. No critical issues were found.
Code review performed by GEMINI - gemini-2.5-flash.
There was a problem hiding this comment.
Core Changes
- Implemented new
sendcommand flags:--typefor character-by-character input,--delayto control typing speed, and--no-enterto omit the trailing newline. - Added a new
snapshotcommand (snapalias) to render the current VT100 screen of a process as plain text, correctly handling TUI applications. - Updated internal
DaemonRequestandProcessManager.SendInputto support these new options, encapsulatingsendparameters in aSendOptionsstruct. - Introduced new unit and integration tests to cover the functionality of the new
sendflags and thesnapshotcommand.
Concerns
No critical concerns found.
Verdict
Approve: The changes introduce valuable new features, are well-implemented, and include comprehensive tests. No critical issues or regressions were identified.
Code review performed by GEMINI - gemini-2.5-flash.
Set PTY and VT emulator to 220×50 (matched) so rendered screen geometry is consistent. Strip CSI sequences with non-digit prefix bytes (>, <, =) before feeding to vt10x — these are kitty keyboard protocol frames that vt10x misinterprets as DECRC (restore cursor), jumping the cursor to (0,0) and corrupting subsequent rendering in TUI apps. Adds regression tests for stripVTProblematic covering normal passthrough, each problematic prefix variant, and mixed interleaving.
There was a problem hiding this comment.
Core Changes
- Introduced new
snapshotcommand (snap) to render the current VT100 screen of a process as plain text, correctly handling TUI applications by replaying escape sequences through a VT100 emulator. - Enhanced the
sendandsend-redactedcommands with new flags:--typefor character-by-character input,--delayto control typing speed, and--no-enterto omit the trailing newline. - Refactored
SendInputto use aSendOptionsstruct for cleaner parameter passing and extended theDaemonRequestwith new fields for these options.
Concerns
No critical concerns found. The changes are well-implemented and thoroughly tested.
Verdict
Approve: The new features are valuable additions, and the implementation is robust, well-tested, and follows good practices.
Code review performed by GEMINI - gemini-2.5-flash.
…corruption TUI processes (gemini, claude, htop, etc.) emit sequences like \x1b[?25l (hide cursor) that execute in the caller's terminal when yoink log prints them, breaking cursor visibility and display. stripANSI() removes all CSI, OSC, and two-byte ESC sequences from log text at format time, leaving the raw ring buffer untouched. Adds regression tests covering hide/show cursor, color codes, OSC titles, alternate screen, and cursor positioning sequences.
There was a problem hiding this comment.
Core Changes
- Introduced new flags for the
sendcommand:--type(simulates typing character by character),--delay(sets inter-character delay for--type), and--no-enter(omits trailing newline). - Added a new
snapshotcommand (with aliassnap) to render the current VT100 screen of a process as plain text, correctly handling TUI applications. - Refactored the internal
SendInputfunction to accept aSendOptionsstruct, encapsulating the new input delivery parameters. - Integrated a VT100 emulator (
vt10x) intomanagedProcessto enable thesnapshotfunctionality and added helper functions to strip ANSI escape codes for safe log and snapshot output.
Concerns
No critical concerns found. The changes introduce new features with appropriate testing and maintain backward compatibility for existing commands.
Verdict
Approve: The changes introduce valuable new features, are well-implemented, and include comprehensive tests. No critical issues were identified.
Code review performed by GEMINI - gemini-2.5-flash.
Summary
--type: sends input character by character, simulating realistic typing on a PTY session — great for asciinema recordings--delay <ms>: configurable inter-character delay (default 50ms); combine with--typeto control typing speed--no-enter: omits the trailing newline, enabling partial input builds or prompts that read a single char (e.g.read -n1)All three flags work on both
sendandsend-redacted, and are fully composable.Implementation
SendInputnow accepts aSendOptionsstruct (TypeMode,TypeDelay,NoEnter,Redacted) instead of a barebool— cleaner than adding more positional paramstype_mode,type_delay,no_enter) added toDaemonRequestfor transport over the Unix socketinput + "\n"path)Tests
6 new unit tests in
services/process_manager_test.go:TestProcessManager_TypeMode_OutputAppears— full string echoed back viacatTestProcessManager_TypeMode_DelayIsRespected— measures elapsed time matchesn_chars × delayTestProcessManager_TypeMode_ZeroDelay— no sleep pathTestProcessManager_NoEnter_NoLineEcho— partial input holdsreaduntil newline sent separatelyTestProcessManager_TypeMode_WithRedaction— type mode + redaction still masks outputTestProcessManager_TypeMode_NoEnter_Combined— all three options together2 new integration tests in
integration/cli_test.go:TestIntegration_SendTypeMode— end-to-end via CLI flags--type --delay 5TestIntegration_SendNoEnter—--no-enter+ separate newline send produces correct echo