Repository navigation
Chat: the composer shows Claude Code's suggested next prompt (#727, D281) - #733
Merged
Merged
Conversation
contursofran
marked this pull request as ready for review
November 11, 2026 18:30
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.
Fixes #727
Source (step 1)
skipTranscript), so it is not in the session file. It goes to the output stream only in-p/SDK mode.terminal.readgives text only, with no styles.❯ ESC[0m ESC[2mcommit this ESC[0m: faint text (SGR 2) after the prompt mark. A sent prompt is not faint (it has a background color).Snapshot()gives the screen as escape sequences and keeps the faint attribute. So contr reads the real dim attribute and does not guess from plain text.Steps
internal/prompt.Suggestion: the text after the last❯, only when all of it is faint.ghostty.Options.OnOutput: called as the plugin takes output.internal/app/nextprompt.go): 300 ms after output, off the UI thread, it reads the tail ofSnapshot()and posts a change.Chat.NextPromptgives the result to the composer.chat-nextsee fixture (the fake claude got anidle:next=state).Tests
TestSuggestion: suggestion, faint with a color, none, typed text, faint that ends, stale after a new prompt, menu choice, bad escape.TestComposerShowsTheNextPrompt,TestComposerTypingHidesTheNextPrompt,TestComposerWithoutNextPromptShowsThePlaceholder.TestOnOutputIsCalledForEachTakenOutput.scripts/see.sh chat-next dark|light: the composer shows "commit this and open a PR" from the fake terminal's faint line.Pre-check
TestSuggestion(faint check),TestComposerShowsTheNextPrompt(hint, and separately the Tab insert),TestOnOutputIsCalledForEachTakenOutput.textKey.scripts/check.shpasses.