{"id":29979389,"url":"https://github.com/debba/rewindtty","last_synced_at":"2025-08-04T13:03:57.212Z","repository":{"id":306947148,"uuid":"1027789393","full_name":"debba/rewindtty","owner":"debba","description":"A terminal session recorder and replayer written in C that allows you to capture and replay terminal sessions with precise timing.","archived":false,"fork":false,"pushed_at":"2025-07-28T14:53:15.000Z","size":161,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-28T16:34:43.750Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/debba.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-07-28T14:34:09.000Z","updated_at":"2025-07-28T15:39:21.000Z","dependencies_parsed_at":"2025-07-28T16:34:48.161Z","dependency_job_id":"d9301e6b-0a75-4370-9529-020649d643ac","html_url":"https://github.com/debba/rewindtty","commit_stats":null,"previous_names":["debba/rewindtty"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/debba/rewindtty","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/debba%2Frewindtty","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/debba%2Frewindtty/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/debba%2Frewindtty/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/debba%2Frewindtty/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/debba","download_url":"https://codeload.github.com/debba/rewindtty/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/debba%2Frewindtty/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268699205,"owners_count":24292425,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-04T02:00:09.867Z","response_time":79,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-08-04T13:02:22.070Z","updated_at":"2025-08-04T13:03:57.178Z","avatar_url":"https://github.com/debba.png","language":"C","funding_links":[],"categories":["C","\u003ca name=\"screen-recorder\"\u003e\u003c/a\u003eScreen recorder"],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cpicture\u003e\n    \u003cimg style=\"max-width:400px;height:auto\"  src=\"assets/logo.png\" alt=\"rewindtty logo\"\u003e\n  \u003c/picture\u003e\n\u003c/p\u003e\n\nA terminal session recorder and replayer written in C that allows you to capture and replay terminal sessions with precise timing.\n\n\u003cp align=\"center\"\u003e\n  \u003cpicture\u003e\n    \u003cimg src=\"assets/demo.gif\" alt=\"rewindtty demo\"\u003e\n  \u003c/picture\u003e\n\u003c/p\u003e\n\n## ⚠️ Disclaimer\n\nThis is a hobby project created for fun and learning purposes. It's still in active development and may contain bugs or incomplete features. If you encounter any issues, please report them in the [Issues](https://github.com/debba/rewindtty/issues) section. Contributions are welcome and encouraged!\n\n## Features\n\n- **Record terminal sessions**: Capture all terminal input/output with accurate timing information\n- **Replay sessions**: Play back recorded sessions with original timing\n- **Session analysis**: Analyze recorded sessions with detailed statistics and insights\n- **JSON format**: Sessions are stored in a structured JSON format for easy parsing\n- **Signal handling**: Graceful shutdown and file closure on interruption\n- **Lightweight**: Minimal dependencies, written in pure C\n- **Web browser player**: Advanced browser-based player with interactive timeline and controls\n\n## Interactive Mode ⚠️ Experimental\n\nrewindtty now supports an **interactive mode** that provides a script-like experience similar to `script` and `scriptreplay` utilities. This mode allows you to record and replay terminal sessions in real-time with enhanced interactivity.\n\n**Note**: This feature is currently experimental and may have limitations or bugs.\n\n### Interactive vs Legacy Mode Comparison\n\n| Feature | Interactive Mode | Legacy Mode |\n|---------|------------------|-------------|\n| **Recording Style** | Real-time shell interaction | Command-by-command capture |\n| **Replay Experience** | Live terminal emulation (like scriptreplay) | Step-by-step command replay |\n| **Session Analysis** | ❌ Not available* | ✅ Full analysis with statistics |\n| **File Format** | Enhanced JSON with timing data | Standard JSON format |\n| **Browser Player** | ✅ Compatible | ✅ Compatible |\n| **Performance** | Higher memory usage | Lightweight |\n| **Use Case** | Full session recording/replay | Command analysis and optimization |\n\n*The analyze tool is not available in interactive mode because commands cannot be reliably stored and parsed from the raw shell interaction data.\n\n## Building\n\n### Prerequisites\n\n- GCC compiler\n- GNU Make\n- Standard C library with GNU extensions\n- Git (for cloning project and submodules)\n\n### Cloning the repository\n\nThis project uses cJSON as a Git submodule.\nMake sure to clone with submodules:\n\n```bash\ngit clone --recurse-submodules https://github.com/debba/rewindtty.git\n```\n\nIf you already cloned the repository without submodules, run:\n\n```bash\ngit submodule update --init --recursive\n```\n\n### Compilation\n\n```bash\nmake\n```\n\nThis will create the executable at `build/rewindtty`.\n\nTo clean build artifacts:\n\n```bash\nmake clean\n```\n\n## Usage\n\n### Recording a Session\n\nTo start recording a terminal session:\n\n```bash\n./build/rewindtty record [--interactive] [file]\n```\n\nThis will create a new session file (defaults to `data/session.json` if no file is specified) and begin capturing all terminal activity.\n\n### Replaying a Session\n\nTo replay a previously recorded session:\n\n```bash\n./build/rewindtty replay [file]\n```\n\nThis will read the session file (defaults to `data/session.json` if no file is specified) and replay it with the original timing.\n\n### Analyzing a Session\n\nTo analyze a recorded session and get detailed statistics:\n\n```bash\n./build/rewindtty analyze [file]\n```\n\nThis will generate a comprehensive analysis report including:\n- Total commands executed and session duration\n- Average time per command\n- Most frequently used commands\n- Slowest commands\n- Commands that generated errors or warnings\n- Helpful suggestions for optimization\n\n### Command Line Options\n\n```\nUsage: rewindtty [record|replay|analyze] [file]\n\nCommands:\n  record [file]    Start recording a new terminal session to specified file (default: data/session.json)\n  replay [file]    Replay a recorded session from specified file (default: data/session.json)\n  analyze [file]   Analyze a recorded session and generate statistics report (default: data/session.json)\n```\n\n## Browser Player\n\nThe `browser_player` directory contains an advanced web-based player for rewindtty sessions that provides enhanced features and a modern interface.\n\n### Features\n\n- **Interactive timeline**: Visual timeline with scrubbing support for easy navigation\n- **Command list**: Sidebar showing all executed commands with click-to-jump functionality\n- **Bookmarks**: Add and manage bookmarks at specific moments in the session\n- **Playback controls**: Play, pause, restart, and speed adjustment (1x, 2x, 4x, 8x)\n- **File loading**: Drag-and-drop or file picker support for JSON session files\n- **Real-time status**: Display current command and session timing information\n- **Modern UI**: Clean, responsive interface built with TypeScript and Vite\n\n### Usage\n\n1. Navigate to the browser_player directory:\n\n   ```bash\n   cd browser_player\n   ```\n\n2. Install dependencies:\n\n   ```bash\n   npm install\n   ```\n\n3. Start the development server:\n\n   ```bash\n   npm run dev\n   ```\n\n4. Open your browser and load a JSON session file to start playing\n\n### Building for Production\n\n```bash\nnpm run build\n```\n\nThe browser player uses xterm.js for terminal emulation and provides a significantly enhanced experience compared to the basic command-line replay functionality.\n\n## File Structure\n\n```\nrewindtty/\n├── src/\n│   ├── main.c          # Main program entry point\n│   ├── recorder.c      # Session recording functionality\n│   ├── recorder.h      # Recording function declarations\n│   ├── replayer.c      # Session replay functionality\n│   ├── replayer.h      # Replay function declarations\n│   ├── analyzer.c      # Session analysis functionality\n│   ├── analyzer.h      # Analysis function declarations\n│   ├── utils.c         # Utility functions\n│   └── utils.h         # Utility function declarations\n├── browser_player/     # Web-based advanced player\n│   ├── src/\n│   │   ├── main.ts     # Entry point\n│   │   ├── player.ts   # Player implementation\n│   │   ├── types.ts    # TypeScript type definitions\n│   │   └── style.css   # Player styles\n│   ├── index.html      # HTML template\n│   ├── package.json    # Node.js dependencies\n│   └── tsconfig.json   # TypeScript configuration\n├── data/\n│   └── session.json    # Default session storage file\n├── build/              # Build output directory\n├── assets/\n│   └── demo.gif        # Demo animation\n├── libs/\n│   └── cjson/          # JSON parsing library\n├── LICENSE             # MIT License\n├── Makefile           # Build configuration\n└── README.md          # This file\n```\n\n## Session File Format\n\nSessions are stored in JSON format in the `data/session.json` file. The format captures timing information and terminal data to enable accurate replay.\n\n## Signal Handling\n\nThe recorder handles interruption signals (like Ctrl+C) gracefully by:\n\n- Closing the session file properly\n- Writing the final JSON structure\n- Cleaning up resources before exit\n\n## Development\n\n### Compiler Flags\n\nThe project uses the following GCC flags:\n\n- `-Wall -Wextra`: Enable comprehensive warnings\n- `-std=gnu99`: Use GNU C99 standard\n- `-g`: Include debugging symbols\n\n### Contributing\n\n1. Fork the repository\n2. Create a feature branch\n3. Make your changes\n4. Test thoroughly\n5. Submit a pull request\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\nCopyright (c) 2025 Andrea Debernardi\n\n## Technical Notes\n\n- Uses standard POSIX system calls for terminal interaction\n- Implements proper signal handling for clean shutdown\n- JSON output format enables integration with other tools\n- Minimal memory footprint and dependencies\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdebba%2Frewindtty","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdebba%2Frewindtty","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdebba%2Frewindtty/lists"}