Skip to content

[Upstream PR #217] feat: improve resume picker session management #161

@quangdang46

Description

@quangdang46

Mirrored from upstream 1jehuang/jcodePull Request #217 by @DarkPhilosophy
Original state: open
Created: 2026-05-15T18:07:25Z · Updated: 2026-05-15T18:07:25Z
Diff: https://github.com/1jehuang/jcode/pull/217.diff
This issue is an auto-mirrored copy. Comments and edits here are local to quangdang46/jcode — do not expect them to propagate upstream.


Summary

  • make /resume default to the current terminal, with Ctrl+Enter preserving the alternate new-terminal action
  • add in-picker session deletion with d, D, or Delete, including an explicit confirmation step
  • clean up local session artifacts on delete and fall back to the current terminal when a new terminal cannot be spawned

Rationale

The picker already presents /resume as a session-management surface. In practice, the previous default made the common case indirect: Enter attempted to spawn another terminal, and if no supported terminal was found the user was left with a manual command to copy instead of resuming the selected session in place.

This keeps the advanced path available while making the default path match the direct user intent:

  • Enter resumes the currently highlighted session in the current terminal
  • Ctrl+Enter still performs the alternate terminal action
  • multi-select remains useful for batch/new-terminal flows
  • deletion is handled where session discovery already happens, with confirmation before removing local artifacts

Behavior changes

  • /resume defaults to current-terminal
  • d, D, or Delete arms deletion; pressing the same key again or Enter confirms; Esc cancels
  • delete removes the local snapshot, journal, backup snapshot, active pid marker, todo state, side-panel state, and client-input artifact for that session id
  • if spawning a new terminal fails in the inline picker path, resume falls back to the current terminal instead of ending at a manual command

Tests

  • cargo test --lib delete_session_artifacts
  • cargo test --lib session_picker_resume_action
  • cargo test --lib test_delete_
  • cargo test --lib test_space_selects_multiple_sessions_and_enter_returns_them

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions