Skip to content

feat: sleep/wake sessions, --clean flag, active-terminal highlight#10

Merged
AThraen merged 2 commits into
mainfrom
feat/sleep-wake-clean-flag
May 6, 2026
Merged

feat: sleep/wake sessions, --clean flag, active-terminal highlight#10
AThraen merged 2 commits into
mainfrom
feat/sleep-wake-clean-flag

Conversation

@AThraen
Copy link
Copy Markdown
Contributor

@AThraen AThraen commented May 6, 2026

Summary

  • Sleep/wake sessions — 💤 button on each session tears down the PTY but keeps the session in the sidebar (muted, at bottom). Click to wake, which re-runs the same restore path used at startup.
  • `--clean` CLI flag — start with no preloaded sessions and skip all state writes for the run, so `state.json` is left untouched. Useful for debugging.
  • Active-terminal accent ring — the active session's pane gets a 2px accent border so it's easy to spot in multi-pane layouts.
  • `AutoResumeClaude` setting — toggle in Settings to disable the auto-injected `--resume ` on session restore.
  • Layout persistence fix — `MainViewModel.Layout` was being saved/loaded but `_currentLayout` never synced after restore; now hooked via PropertyChanged.
  • TerminalBridge accelerator-key fix — newer WebView2 WPF wrapper forwards accelerators through standard `PreviewKeyDown`; switched off the missing `CoreWebView2Controller.AcceleratorKeyPressed`.
  • CLAUDE.md updated with all of the above.

Test plan

  • Launch the app normally — saved sessions restore as before.
  • Launch with `--clean` — no sessions appear, settings/sessions are not modified on close.
  • Sleep an active session — sidebar shows muted dormant entry at bottom; pane disappears; remaining panes re-layout.
  • Wake a dormant session — terminal relaunches; if it's a Claude session and `AutoResumeClaude` is on, prior conversation is picked up.
  • Multi-pane layout — selected pane shows a 2px accent ring; switching active sessions moves the ring.
  • Toggle `AutoResumeClaude` off, restart — Claude sessions launch without `--resume`.
  • Switch layout (e.g. 2x2), close and reopen — layout is restored.
  • Ctrl+T / Ctrl+W / Ctrl+F still work when terminal has focus (accelerator-key forwarding).

🤖 Generated with Claude Code

AThraen and others added 2 commits May 6, 2026 21:12
- Sleep/wake: sessions can be put dormant (PTY torn down, sidebar entry kept) and woken later via the same restore path.
- --clean CLI flag: launch with no preloaded sessions; SaveStateAsync no-ops for the run so prior state.json survives untouched.
- Active terminal accent ring: highlights the active pane with a 2px border in the session's accent color so it's easy to spot in multi-pane layouts.
- Settings: AutoResumeClaude toggle gates the auto --resume injection on session restore.
- Layout persistence: hook MainViewModel.Layout property changes so the saved layout actually applies on startup.
- TerminalBridge: switch from CoreWebView2Controller.AcceleratorKeyPressed to standard WPF PreviewKeyDown — the newer WebView2 wrapper forwards accelerators through normal key events.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- README: add Sleep & Wake feature line; note AutoResumeClaude is now toggleable; add SSH remote sessions feature line; document --clean flag in build-from-source section.
- CLAUDE.md:
  - Expand --clean section with what each piece (App.CleanStart, OnLoaded, SaveStateAsync) does.
  - Move active-terminal highlight to its own subsection under Color/Theme with implementation detail (outer-ring Border, Tag-stashed accent).
  - Rewrite Sleep/Wake section with the full method-by-method implementation map and bypass-CloseCommand rationale.
  - Update Session Lifecycle to enumerate the three termination paths (close, sleep, wake) instead of just close.
  - Add Layout persistence subsection explaining the PropertyChanged sync that makes saved layouts actually restore.
  - Note in TerminalBridge bullet that accelerator keys come via PreviewKeyDown in the newer WebView2 wrapper.
  - Update Known Conventions: BuildDormantSidebarItem, _dormantSidebarItems, the outer-ring wrapper indirection, and the SaveStateAsync clean-mode contract.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@AThraen AThraen merged commit 5520df4 into main May 6, 2026
1 check passed
@AThraen AThraen deleted the feat/sleep-wake-clean-flag branch May 6, 2026 19:22
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