Repository navigation
docs(readme): Refresh quickstart and cut boxes - #220
Merged
Merged
Conversation
why: Replace repeated boxed serialize_vt_snapshot() snippets with executable plain Python and console examples that surface core inspection, synchronous process control, pytest/syrupy testing, CLI disassembly, and pure-Python tmux compositing while shrinking README.md. what: - Collapse optional extra install fences into prose and rewrite the opening quickstart around Terminal.feed(), term.committed, Snapshot.lines/cursor, Cell.style, and RowView.runs without libvt.testing - Replace the async-only PTY example with synchronous open_terminal() and send_line(), noting Windows build 26100 ConPTY and .snapshot caveats alongside pointers to libvt.aio (AsyncTerminalStream, open_pty()) and pytest vt_pty replay capture - Keep wide-char assert_screen_box(), consolidate testing into a real pytest test_status_diff() using vt_factory(..., recorder=vt_recorder), feed_str(), tmp_path scrubbing, and vt_screen(..., diff=...), plus --vt-replay-dir -> python -m libvt replay and a runnable syrupy vt_snapshot test - Contrast render() and strip() on overwrite input, state render() viewport/no-scrollback boundaries and defaults accurately, and run POSIX-safe printf | python -m libvt explain - Cover Snapshot.format()/to_dict(), drain_replies()/Profile/Policy/ Limits, prompt_zones/cwd/Notification, migrating-from-pyte, and add a pure-Python libvt.contrib.tmux capture and window-compositing example while fixing the vt_snapshot anchor link
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #218
Stacked on #219 (
docs-codeblocks), exercising its plainpython(including two-passsyrupyvt_snapshotexecution) and runnableconsolecode-block runner acrossREADME.md.1. Owner and boundary
README.md(package landing page and PyPIreadme). No runtime modules undersrc/libvt/changed.sync/async, CLI/API, single/batch, orN/A): VerifiedREADME.mdagainsttests/_docs_codeblocks.py(pytest -m documentation README.md),tests/test_libvt.py(test_markdown_code_fences_are_collected_and_classified,test_documented_examples_include_explicit_imports),libvt.contrib.subprocess(open_terminal,run_terminal,send_line, Windows build 26100 ConPTYReleasePseudoConsolecheck,.snapshot/.snapshot()boundaries),libvt.aio(AsyncTerminalStreamandopen_pty),libvt.pytest_plugin(vt_factorydefaultrecorder=Nonevsvt_terminal/vt_ptyand--vt-replay-dir),libvt.contrib.syrupy(vt_snapshot,VtSnapshotExtension),libvt.contrib.tmux(decode_tmux_capture,parse_tmux_window_layout,composite_tmux_window,TmuxPaneSync,tmux_version=),python -m libvtCLI subcommands (with POSIX\033printf), and all 30https://libvt.git-pull.com/links and anchors against freshly built Sphinx-WHTML.README.md; VT emulation semantics are unchanged so VT byte-replay comparisons inREVIEW.mdsection 2 are inapplicable.2. Failure before the fix (
N/Afor docs, lockfile bumps, or pure refactors)N/A(documentation refresh). Net length shrank from 278 to 268 lines (-10), Quickstart shrank from 7 to 5 subsections, and rendered boxes shrank from 5 to 1 while adding live-testedpytest,syrupy,python -m libvt, and pure-Pythontmuxexamples. Negative controls verified that perturbing each of the 7 plainpythonblocks (including stripping explicit imports) and the runnablepython -m libvt explainconsoleblock failspytest README.mdfor cause and passes again once restored.3. Verification and tool disclosure
N/A):uv run ruff format --check .,uv run ruff check .,uv run ty checkacross Python3.12–3.15and--python-version 3.12 --python-platform win32(plusty checkon all 7 extractedREADME.mdPython blocks),PYTHONDONTWRITEBYTECODE=1 uv run python -B scripts/check_workarounds.py,uv run pytest README.md -v(10 passed),uv run pytest -m documentation(47 passed),uv run pytest -m ""(1409 passed, 3 skipped),uv run sphinx-build -W -b dirhtml -d docs/_build/doctrees docs docs/_build/htmlplus built-HTML link/anchor verification (all 30 URLs verified, fixing the brokenvt_snapshotanchor), anduv buildwheel cleanliness (48libvt-only entries) + unpacked-sdistpytest README.md(10 passed)..github/workarounds.tomlupdates (Noneif none):None.git,gh,uv,ruff,ty,pytest,sphinx-build.