feat: close window when last terminal exits (term:closeonlasttermclose)#3058
feat: close window when last terminal exits (term:closeonlasttermclose)#3058apanchoo wants to merge 3 commits intowavetermdev:mainfrom
Conversation
Adds a new global setting `term:closeonlasttermclose` that automatically closes the window when the last shell/terminal block exits. When enabled, typing `exit` in the last remaining terminal closes the window immediately (no delay), while non-last terminals are unaffected. Closes wavetermdev#3026 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
🚧 Files skipped from review as they are similar to previous changes (2)
WalkthroughAdds a new global configuration key Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Code Review SummaryStatus: No Issues Found | Recommendation: Merge The inline issue previously identified (fail-closed error handling in Files Reviewed (5 files)
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@pkg/blockcontroller/shellcontroller.go`:
- Around line 665-673: The DB reads in the last-shell detection loop currently
ignore errors by continuing (wstore.DBGet[*waveobj.Tab](ctx, wsTabId) and
wstore.DBGet[*waveobj.Block](ctx, wsBlockId)); change this to fail closed by
returning false when either DBGet returns a non-nil error (or nil result with an
error), instead of continuing, so any read error makes the function
conservatively return false; update the logic around the tab/block retrieval and
the loop over tab.BlockIds accordingly.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: ccf9be1b-d0c4-4408-a949-2a0d917f18f6
📒 Files selected for processing (5)
frontend/types/gotypes.d.tspkg/blockcontroller/shellcontroller.gopkg/wconfig/metaconsts.gopkg/wconfig/settingsconfig.goschema/settings.json
Fail closed on DB errors instead of skipping blocks with continue, which could undercount shell blocks and incorrectly trigger window close. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Closes #3026
Summary
term:closeonlasttermclose(boolean, defaultfalse)cmd:closeonexitwhich defaults to 2s)How to enable
Add to your
settings.json:{ "term:closeonlasttermclose": true }Test plan
exit→ window closes immediatelyexitin one → only that block stays (no close)