Repository navigation
Reopen the last closed session with Ctrl+Z (Cmd+Z on macOS) - #135
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_firstinheadless.rspresses 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 reacheson_keybefore 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
claudethat 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.