fix: update vt100 0.15 → 0.16 to restore dim (SGR 2) attribute in snapshots#16
Merged
fix: update vt100 0.15 → 0.16 to restore dim (SGR 2) attribute in snapshots#16
Conversation
…pshots vt100 0.15 did not track the dim/faint attribute (SGR 2) at all — no TEXT_MODE_DIM bit and no handler in sgr(). As a result, state_formatted() never re-emitted ESC[2m, so text rendered as dim in the live session would appear as normal-weight text after a detach/re-attach cycle. vt100 0.16 adds TEXT_MODE_DIM and handles SGR 2 → set_dim(), and state_formatted() correctly re-emits Intensity::Dim as ESC[2m. Confirmed via byte-level comparison of live PTY output vs snapshot: ORIGINAL: ESC[2mNo ESC[0m (faint) 0.15 snap: ESC[m No (dim lost) 0.16 snap: ESC[m ESC[2mNo (dim preserved) API changes in 0.16: - screen.errors() removed → dropped from debug log format string - parser.set_size(rows, cols) → parser.screen_mut().set_size(rows, cols) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
問題
detach → re-attach 時に
dim/faintテキスト(SGR 2)の属性が消える。claude yesのような yes/no ダイアログで "No" が faint にならない現象の原因。原因
vt100 0.15 は
dim属性を完全未実装:attrs.rsにTEXT_MODE_DIMビットなしsgr()ハンドラに&[2]ケースなし → SGR 2 受信時に無視state_formatted()は dim を再生成しない修正
vt100 0.16 へ更新。0.16 での変更:
TEXT_MODE_DIM = 0b0000_0010を追加sgr()に[2] => self.attrs.set_dim()を追加state_formatted()がIntensity::Dim→ESC[2mとして正しく再出力API 変更対応
screen.errors()parser.set_size(rows, cols)parser.screen_mut().set_size(rows, cols)確認方法
byte-level 比較で修正を確認済み(調査ブランチ
debug/display-investigation#15 参照):Test plan
nix run .#test-nvimで起動printf '\033[2mfaint text\033[0m\n'を実行🤖 Generated with Claude Code