debug: instrument VT pipeline for ANSI display investigation#15
Closed
debug: instrument VT pipeline for ANSI display investigation#15
Conversation
…stigation Instrument the VT parse/snapshot/frame pipeline to diagnose the ANSI escape sequence width misalignment that causes line-wrap corruption with colored output (e.g. claude yes/no prompts). Three debug log targets, each enabled by setting the env var to a file path: - PTERM_DEBUG_DAEMON: daemon-side read_pty (n, esc count, cursor, errors), snapshot (len, esc count, size, wrapped rows), send_snapshot, flush_pty, and resize events. - PTERM_DEBUG_FRAMES: bridge-side protocol frame decode (type, len, esc count) and final stdout batch writes (len, esc count). - PTERM_DEBUG_OUTPUT: raw bytes written to Neovim stdout (pre-existing). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
3 tasks
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.
Summary
追加したログ
PTERM_DEBUG_DAEMONread_ptyのパーサ状態(n, ESC数, cursor, errors)、snapshotの統計(len, ESC数, wrapped行)、send_snapshot/flush_pty/resizePTERM_DEBUG_FRAMESPTERM_DEBUG_OUTPUT使い方
PTERM_DEBUG_DAEMON=/tmp/pterm_daemon.log \ PTERM_DEBUG_FRAMES=/tmp/pterm_frames.log \ PTERM_DEBUG_OUTPUT=/tmp/pterm_output.bin \ nix run .#test-nvim調査後はこのブランチを削除またはログコードをstrip予定。
Test plan
nix run .#test-nvimでNeovimが起動するclaude yes)PTERM_DEBUG_DAEMONログで[snapshot] wrapped=に異常な行がないか確認[read_pty] errors=でvt100パーサエラーが出ていないか確認PTERM_DEBUG_FRAMESログでOUTPUT/SCROLLBACKのESC数を比較🤖 Generated with Claude Code