Skip to content

fix: improve session snapshot and terminal lifecycle management#17

Merged
ttak0422 merged 2 commits intomainfrom
fix/session-snapshot-improvements
Mar 22, 2026
Merged

fix: improve session snapshot and terminal lifecycle management#17
ttak0422 merged 2 commits intomainfrom
fix/session-snapshot-improvements

Conversation

@ttak0422
Copy link
Copy Markdown
Owner

@ttak0422 ttak0422 commented Mar 20, 2026

Summary

  • detach 時にクライアント端末へクリーンアップシーケンスを送出(マウスモード・bracketed paste・alt screen・カーソル表示のリセット)
  • scrollback 容量を 0 → 10,000 行に変更し、再アタッチ後に履歴を参照可能に
  • クライアント未接続中に DA1/DA2 クエリへ応答を返し、アプリが capability detection でハングするのを防止
  • alt screen がアクティブな状態でスナップショットを送る際、先頭に ESC[?1049h を付加し再アタッチ後に正しく alt screen へ入るように修正
  • ウィンドウタイトルをトラッキングし、スナップショットで OSC 2 を再送して reattach 後にタイトルを復元

Test plan

  • 通常セッション(alt screen なし)で detach → reattach してスナップショットが正常に再現されることを確認
  • vim / htop 等 alt screen を使うアプリで detach → reattach して画面が正しく復元されることを確認
  • detach 後にクライアント端末のマウス・カーソルが正常な状態に戻ることを確認
  • ウィンドウタイトルを設定するアプリで reattach 後にタイトルが復元されることを確認
  • cargo build が通ること(CI)

🤖 Generated with Claude Code

ttak0422 and others added 2 commits March 20, 2026 22:04
- (H) Send terminal cleanup sequences on detach to reset mouse modes,
  bracketed paste, alternate screen, and cursor visibility in the
  client terminal
- (B) Increase scrollback capacity from 0 to 10,000 lines so history
  is available after reattach
- (G) Respond to DA1/DA2 queries with canned responses when no clients
  are connected, preventing apps from hanging on capability detection
- (A) Prepend ESC[?1049h in snapshots when alternate screen is active
  so reattaching clients properly enter alternate screen mode
- (C) Track window title via vt100 Callbacks and restore it in
  snapshots via OSC 2 sequence on reattach

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@ttak0422 ttak0422 merged commit 28ec9d8 into main Mar 22, 2026
2 checks passed
@ttak0422 ttak0422 deleted the fix/session-snapshot-improvements branch March 22, 2026 09:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant