GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — asciicast-utils-python/CLAUDE.md at main · ericfitz/asciicast-utils-python

Expand file tree

/

CLAUDE.md

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
17 lines (11 loc) · 1.46 KB
/

CLAUDE.md

Copy path

File metadata and controls

17 lines (11 loc) · 1.46 KB
Raw
Copy raw file
Download raw file
Outline
Edit and raw actions

CLAUDE.md

Python utilities for recording and preprocessing asciicast v2 terminal sessions. Python 3.8+. record_session.py depends on websockets (for --monitor); consolidate_input.py is standard library only. Each script carries PEP 723 inline metadata so uv run installs dependencies without a project.

Running

uv run record_session.py                                    # default shell, auto-named output
uv run record_session.py --shell /bin/bash --output my.cast
python3 record_session.py --shell zsh                       # plain Python needs websockets installed

Architecture

record_session.py — AsciinemaRecorder. Forks a child under a PTY (pty.openpty() + os.fork()), multiplexes fds with select.select(), and writes asciicast v2: a JSON header (version, dimensions, timestamp, shell) followed by newline-delimited [timestamp, "i"|"o", data] events. Timestamps are rounded to 3 decimals; termios settings are saved and restored; Ctrl+C is forwarded to the child; terminal size is detected and applied to the PTY. Works on macOS and Linux.

consolidate_input.py — InputConsolidator. Accumulates per-keystroke "i" events into one "c" (command) record per typed line. Original events are preserved unchanged; the "c" record is appended after the flushing "i" event with the first keystroke's timestamp. Accumulation spans intervening non-"i" events (shell echo). Flush triggers: CR, LF, Ctrl+C, or end of file.

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.