Skip to content

fix(session_picker): switch to remaining session when deleting active one#359

Merged
sudo-tee merged 1 commit intosudo-tee:mainfrom
hermandavid:main
Apr 17, 2026
Merged

fix(session_picker): switch to remaining session when deleting active one#359
sudo-tee merged 1 commit intosudo-tee:mainfrom
hermandavid:main

Conversation

@hermandavid
Copy link
Copy Markdown
Contributor

Summary

Fix <C-d> in the session picker creating a new session when deleting the active one instead of switching to a remaining session.

Problem

Deleting the active session always spawned a new session, even when other sessions existed. The user would land on an unexpected blank session, and the picker would show the leftover entries plus the freshly-created one. This was also inconsistent with deleting a non-active session, which simply removes the entry.

Fix

The delete action now switches to the most recently updated remaining session via core.switch_session, and only falls back to core.create_new_session when no sessions remain.

Behavior

  • Active session deleted with others remaining → switch to most recent remaining.
  • Active session deleted when it's the only one → create new (unchanged).
  • Non-active session deleted → unchanged.

@sudo-tee
Copy link
Copy Markdown
Owner

Thanks this seems like a greast fix.

@sudo-tee sudo-tee merged commit efb08e4 into sudo-tee:main Apr 17, 2026
5 checks passed
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.

2 participants