Skip to content

Reopen the last closed session with Ctrl+Z (Cmd+Z on macOS) - #135

Merged
m4rocks merged 1 commit into
mainfrom
undo-close-session
Nov 20, 2026
Merged

m4rocks merged 1 commit into
mainfrom
undo-close-session

Conversation

@m4rocks

@m4rocks m4rocks commented Nov 20, 2026 •

Copy link
Copy Markdown
Owner

Summary

A session closed by mistake had to be found again in RECENT and resumed by hand. Now Ctrl+Z (Cmd+Z on macOS) resumes the sessions you closed since Claudiu started, the last closed first, one per press. A session that is gone from the history, has no Claude conversation, or is already running again is skipped.

The key stays where it already meant something. The editor keeps it for undo. Off macOS, a shell keeps Ctrl+Z to suspend its job. With nothing left to reopen, the key goes to the terminal as before.

Evidence

the_undo_key_reopens_closed_sessions_the_last_closed_first in headless.rs presses the key in a shell, in the editor and in a Claude terminal. It fails if either guard or the reopen is removed; I checked all three by mutating the code. cargo test --locked: 547 passed, 0 failed, on Windows. cargo clippy --locked --all-targets -- -D warnings: clean. On macOS, Rune's docs say Cmd+Z reaches on_key before the standard Edit menu's Undo; CI runs the test there.

I also ran the debug build on Windows, with a throwaway data folder and a stand-in claude that prints its arguments, and two sessions running. Ctrl+Shift+W closed Alpha, leaving RUNNING 1 and RECENT 1. Ctrl+Z started it again with --resume conv-alpha, back to RUNNING 2 with Alpha shown. I did not try it by hand on macOS or Linux.

Risk

Off macOS, Ctrl+Z in a Claude terminal now reopens a session when one is waiting, so Claude Code never sees that press. Before, Claude Code on Linux would suspend itself on it, which leaves a Claudiu tab stuck. The list lives in memory only, so it is empty after a restart. Revert the commit to undo.

@vercel

vercel Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
claudiu Ready Ready Preview Nov 20, 2026 1:11pm UTC

@m4rocks
m4rocks merged commit 55752c6 into main Nov 20, 2026
5 checks passed
@m4rocks
m4rocks deleted the undo-close-session branch November 20, 2026 13:20

This branch was successfully deployed

1 active deployment
Preview — 7c339e62 Deployed Nov 20, 2026 by vercel[bot]
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