warp icon indicating copy to clipboard operation
warp copied to clipboard

auto close tab after 7 day.

Open negentropi opened this issue 7 months ago • 9 comments

Pre-submit Checks

Describe the solution you'd like?

set a custom duration, close tab base on that inactive(did tab have being bring to the front) duration.

Is your feature request related to a problem? Please describe.

too many tabs open massy, and slow things down. then require manual close unimportant old tabs.

Additional context

No response

Operating system (OS)

macOS

How important is this feature to you?

4

Warp Internal (ignore) - linear-label:39cc6478-1249-4ee7-950b-c428edfeecd1

None

negentropi avatar Apr 29 '26 05:04 negentropi

@Manoj7ar

The stale-active distinction is a useful refinement for this request. Eligibility should be based on recency signals such as last foreground/user interaction and recent terminal/agent output, not only whether a PID or agent session still exists.

I would keep the safer behavior as archive/recover rather than destructive close, and treat unsaved editor changes as a hard exclusion. Running-but-idle sessions could be eligible only after the configured inactivity window if they have had no recent input/output and no unsaved work.

Reasoning

Response-mode triage because this run was triggered by an @oz-agent mention on an already-triaged enhancement; no label changes should be made.

Code/context checked:

  • app/src/undo_close/settings.rs defines the existing undo-close setting as general.undo_close.enabled plus a short general.undo_close.grace_period defaulting to 60 seconds. This is temporary undo recovery, not long-term inactive-tab archival.
  • app/src/undo_close/stack.rs stores closed windows/tabs/panes and expires them with a timer; when expired, it discards pane/tab state and marks conversations historical. This is relevant to an archive/recover design but is not a persistent closed-tabs/archive history by itself.
  • app/src/pane_group/mod.rs closes panes/tabs via hidden-for-close/undo-close paths and cleans up/discards panes after expiry. It also has has_active_code_pane_with_unsaved_changes, which the tab UI uses as an unsaved indicator.
  • app/src/quit_warning/mod.rs already summarizes long-running commands, shared sessions, and unsaved code changes before close/quit. That logic treats running foreground work as a warning condition, not as an inactivity heuristic.
  • app/src/session_management.rs includes SessionNavigationData.last_focus_ts and CommandContext::{RunningCommand, RunningAIBlock, LastRunCommand, LastRunAIBlock}; RunningSessionSummary currently classifies any running command/AI block as long-running if it is not a viewer/read-only session. It does not distinguish running-but-idle from recently active.
  • app/src/terminal/view.rs sets last_focus_ts when focus is redetermined and tracks TerminalViewStateChange timestamps for Normal/Errored/LongRunning transitions. I did not find a durable per-tab last-output timestamp suitable for a stale-active cleanup rule.
  • app/src/tab.rs renders indicators for unsaved code changes, active agents, shell/long-running state, shared sessions, and errors; an 'eligible for cleanup' tag would likely extend this surface and vertical-tabs equivalents.

Likely product/technical shape: add a persisted setting for inactive-tab cleanup, persist per-tab last foreground/user-interaction recency, add terminal/agent output recency if stale-active sessions should be eligible, hard-skip unsaved code/editor changes, and archive to a recoverable history rather than killing sessions outright. If process/session state cannot be resumed safely, the UI should be explicit that archived items are recoverable as history/context rather than live processes.

Routing: primary areas remain area:window-tabs-panes, area:settings-keybindings, and area:performance; relevant SMEs from .github/STAKEHOLDERS include @vkodithala for pane/tab management, @lucieleblanc for settings UI, and @zachbai if the cleanup indicator/UX touches vertical tabs or agent status.

Duplicate check: none of the provided recent/open issues appears to request inactive tab auto-archive/auto-close. The closest tab issue listed, #9539, is about vertical-tabs settings popup click handling and is not a duplicate.

This is my automated analysis and may be incorrect. A maintainer will verify the details.

Powered by Oz

warp-for-oss[bot] avatar Apr 29 '26 05:04 warp-for-oss[bot]

@oz-agent 1.it actively running as warp is running. 2.if involved unsaved change that would dont be auto close and would give a tag, and if that active running is not factually not usable stuff.

negentropi avatar Apr 29 '26 06:04 negentropi

@oz-agent My suggestion: this should behave more like auto-archive than hard-close.

Proposed behavior:

  1. If a tab has been inactive for the configured duration (e.g. 7/14/30 days), move it into a Closed Tabs / Archived Tabs history instead of permanently deleting it.

  2. Tabs with:

  • running foreground processes
  • active agent sessions
  • unsaved editor changes

should be excluded from auto-cleanup.

  1. Optional “eligible for cleanup” indicator: a small stale/inactive tag in the tab UI before archival, so users can notice and keep it alive if needed.

Good heuristic for inactivity: not just “tab exists,” but last brought to foreground / last user interaction.

Settings shape could be:

Auto-clean inactive tabs: Off / 7d / 14d / 30d / Custom
Archive instead of delete: On (default)
Skip active processes: On (default)
Skip unsaved changes: On (default)

This keeps workspace performance healthy without risking active work or losing context.

Manoj7ar avatar Apr 29 '26 17:04 Manoj7ar

@Manoj7ar good idea. but for the active proc: for example say you run codex 'what is negentropy?' then you just left it there forever, yeah it running on the surface, but it just like your 200+ browser tab that you never going to visit again and even you remember you might not going to find from that mass as first you would do.

and unread remaining unsolve.

negentropi avatar Apr 30 '26 13:04 negentropi

@happyf-weallareeuropean That’s fair, I’d treat that as stale-active, not truly active.

A process merely existing shouldn’t be enough to keep the tab forever.

Better rule might be:

  • running + recent output/input → keep alive
  • running but idle for long enough → eligible for archive
  • unsaved changes → never auto-archive

So if you ran OpenAI Codex once and left it sitting there for weeks with no interaction/output, it could still be archived.

Important part: archive, not kill.

Meaning the process/session state could either:

  • be resumable (best case), or
  • at minimum stay recoverable in history instead of cluttering the active tab bar.

That way “forgotten but technically still running” tabs don’t live forever.

Manoj7ar avatar Apr 30 '26 13:04 Manoj7ar

@oz-agent Updating my earlier suggestion based on the edge case raised:

I’d distinguish active from stale-active.

A process merely existing (PID alive) shouldn’t make a tab immortal.

Better cleanup heuristic:

  • running + recent output/input → keep active
  • running but idle for long enough → eligible for archive
  • unsaved changes → never auto-archive

So something like OpenAI Codex that was run once and left idle for weeks shouldn’t block cleanup forever just because the process still exists.

Key distinction: archive, not kill.

That preserves recoverability while keeping the active tab bar clean.

So eligibility probably needs to be based on interaction recency / output recency, not just process existence.

Manoj7ar avatar Apr 30 '26 13:04 Manoj7ar

Hey @happyf-weallareeuropean - thanks for the contribution. This is an interesting feature request - I wonder if auto-closing stale tabs is something that other terminal emulators support? I'm marking this warp:tracking for now, would love if you could add some color around the use cases, and any prior art here. If this gets interest from the community, would love to explore.

vkodithala avatar Jul 21 '26 14:07 vkodithala

@vkodithala Thx for tracking mam.

I have not seen this in another terminal, but idea was inspired by Arc Browser (known as first vertical tab browser).

When I first started using Arc, I noticed lot recent tabs disappeared automatically. At first, I found it really annoying that I couldn't disable the feature. even considered switching browsers, but eventually gave up and mentally justified it, at least Arc still kept a tab history with separate filters for all archived tabs / automatically archived tabs.

After using it for a while, though, I started to understand the value. I realized I almost never went back to those old tabs. Even when I did need something again, I would usually just search for it again or rarely but search it in browser history if i have keyword. Once I noticed that, I started to appreciate the automatic cleanup.

The browser stayed much cleaner, tab navigation became easier, and memory use was lower. I eventually changed the archive period from 30 days to 24 hours, and that worked even better for me. but i'd think 2d~3d is more sweet spot for me but now stuck at 7 day.

Image btw, i think 12h is too short for default tho.

Before Arc, I often had 200~300 tabs open in Chrome. Most of them were unloaded and just sitting there because I was afraid of losing something, but I also did not want to review and close everything manually.

no terminal, arc is the conceptual art

did ppl like it? i think some ppl did love it lot:

Hey @happyf-weallareeuropean - thanks for the contribution. This is an interesting feature request - I wonder if auto-closing stale tabs is something that other terminal emulators support? I'm marking this warp:tracking for now, would love if you could add some color around the use cases, and any prior art here. If this gets interest from the community, would love to explore.

negentropi avatar Jul 21 '26 15:07 negentropi

@vkodithala and one more popular project like t3-code they have auto settle after a customizable duration of inactive

Image

It's generally really excited to see Warp can integrate with this. It's really important for really DX.

negentropi avatar Sep 09 '26 02:09 negentropi