Slobodan Milnovic accepted merge request !3: #2 Implement full playback engine, controls, and documentation at Slobodan Milnovic / gtermreplay

Slobodan Milnovic
2026-03-22T10:58:22Z

Add the complete playback system with concurrent goroutine-based timeline replay, media-player controls, and all supporting features:

Playback engine (playback.go):

State machine (stopped/playing/paused) with goroutine lifecycle

Timeline loading from classic and advanced script(1) timing formats

Synthetic timeline (1 sec/line) for files without timing data

Seek operations with haltAndCapture() to prevent TOCTOU races

Pause-during-delay support via delayOffset with FP clamping

Generation counter (syncGen) to discard stale fyne.Do closures

Variable speed (0.25x–16x) preserved across pause/seek

Display and rendering:

vt10x-to-Fyne TextGrid bridge (render.go) with full color mapping (16 ANSI, 256 xterm, 24-bit true color)

Terminal resize via SIGWINCH events in advanced timing format

Scrubber bar with click-to-seek (scrubber.go)

Time and speed labels (time.go)

Features:

Text search with real-time highlighting during playback (search.go)

Text selection with click-drag and double-click word select (selection.go)

Timeline bookmarks with wrap-around navigation (bookmarks.go)

Screen export to text file (export.go)

Keyboard shortcuts for all controls (shortcuts.go)

Infrastructure:

GitLab CI/CD pipeline: test (vet + race), build, release on semver tags

Comprehensive test suite with race detector coverage

Test data files for classic and advanced timing formats

Documentation:

User manual with full feature reference and troubleshooting

Architecture guide with data flow diagrams, concurrency model, state machine, color mapping, and known limitations

Contributing guide with build prereqs, testing, and code style

Bug fixes from review rounds:

Add syncGen bump in termInitiator() to prevent stale screen updates

Replace StateAndFraction() with haltAndCapture() in skip/bookmark/scrubber

Restructure halt/stop hierarchy to prevent speed-on-seek regression

Remove dead onSeek callback (onSeekReplay always set)

Fix deprecated Fyne API calls (theme colors, clipboard)

Add nil guard in replayTo() for onSeekReplay callback

Fix search count label format (show "N found" vs "1/N")

Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com