Repository navigation
fix(tui): Ctrl+L and :clear start a new session like /clear - #483
Merged
Merged
Conversation
"Clear session" (Ctrl+L, confirmed) and `:clear` only emptied the chat on screen and said "Session cleared". The session, its history, undo stack and goal were untouched, so the next prompt still sent the whole old conversation and resuming brought the old transcript back. Both now set `clear_session_requested`; the run loop, once idle, runs the same `/clear` handler (`IdleLoopKey::ClearSession`), keeping the prompt draft. A request made mid-turn is refused with a status line instead of firing on some later keypress. Co-Authored-By: Claude Opus 5.5 <[email protected]>
mrnasil
enabled auto-merge (squash)
November 25, 2026 13:27
Merged
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.
Problem
There are three ways to "clear the session"; only
/clearactually did:/clear(run/slash.rs) replaces the session, clears history and undo, drops the goal and todos.:clear(input.rs) only ranapp.messages.clear()and showed "Session cleared".After Ctrl+L the screen was empty, but the next prompt still sent the whole old conversation to the model, and resuming brought the old transcript back.
Fix
app.clear_session_requested(viarequest_clear_session).IdleLoopKey::ClearSession. That is the samehandle_slash("/clear", …)call/clearuses. The prompt draft is kept (it is not the command).Tests
apply_idle_loop_key_covers_session_and_slash_arms:ClearSessiongives a new session id, the old turn is gone, and the draft is kept.run_headless_ctrl_l_confirm_starts_a_new_session: Ctrl+L, Enter, quit through the real loop.:clearrequest the clear; the transcript is untouched until the loop runs/clear; mid-turn is refused.🤖 Generated with Claude Code