Repository navigation
Composer history: a recalled command is one step, however many lines it has (#389) - #438
Merged
Merged
Conversation
…it has #389 (approved for v0.22): after Up recalled a multiline or soft-wrapped command, further Up presses moved the caret through its rows before history moved on: a recalled five-line command took five extra presses to pass, and tests/composerHistory.test.ts codified that. - TerminalApp: while the composer shows an unchanged recalled entry and the person has done nothing else since, Up and Down step entry by entry (historyStep). Any other composer key (typing, pasting, deleting, moving the caret or a word, Home/End, selecting, Select All) makes it a draft again: Up/Down move between its rows as before, and the next recall starts a fresh snapshot. The flag is combined with ComposerHistory's text check, so anything else that replaces the text also ends browsing. - The slash-menu exit path and the running-command path use the same step. Down past the newest entry restores the exact draft, as before. Editing a fresh multiline draft, completion and slash menus, the agent shelf and the background bar keep their precedence. CommandEditor is unchanged. The test that codified the old behavior is replaced. New tests: five-line and soft-wrapped entries step once per press both ways, oldest and newest ends, the exact multiline draft restored, and each way of leaving browsing (typing, caret, word, Home, selection, paste). Four fail on dev. Refs #389
This was referenced Oct 18, 2026
Open
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.
Why (#389)
After Up recalled a multiline or soft-wrapped command, further Up presses moved the caret through its rows before history moved on. On
deva recalled five-line command took five extra presses to pass (trace on the issue), and a test codified that behavior.What changed
TerminalApp.historyStep).ComposerHistory's own text check, so anything else that replaces the text also ends browsing.composerHistoryEligible);CommandEditor,/history, history providers and journals.The
History n/Nposition indicator is a separate slice, as decided.Verification
deva8b383c2; the transitions test passes there too, sincedevnever browses (it guards the new state).npm run verifyon29d73a69: 3143 pass, 1 fail, 2 skipped (load 9 at start, 20 at the end). The one failure is the live compatibility harness timing out waiting for a prompt (tests/compatibilityHarness.test.ts); with that file and the live input-ownership tests rerun at load 5: 16/16. CI runs on this PR.Physical QA (not done)
Ghostty and Terminal.app; zsh, Bash and Fish. Run a multi-line command (Ctrl+J between lines) and a few one-line commands. From an empty composer: Up recalls the newest; each further Up moves one command, passing the multi-line one in one press; Down comes back the same way; Down past the newest restores what you had typed. Recall the multi-line command, press Left (or type a character), then Up: the caret moves within it. Narrow window (about 46 columns) with a long one-line command: one press per entry.
Refs #389