Conversation
readline calls the application-provided Completer on nearly every keystroke, for both menu completion and as-you-type autocomplete (both funnel through commandCompletion). A panic in that user code — a bad completer or transient command-tree state — propagated out of the completion path and crashed the whole interactive shell. Recover around the completer invocation and surface the panic value as a completion message instead, so a single faulty completion degrades into a visible error rather than taking down the process. Because both completion paths share commandCompletion, this one choke point covers them all. This is the readline-side fix for reeflective/console#81, which worked around the crash by recovering in its own completer; downstream callers no longer need to guard their completers against panics.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #116 +/- ##
==========================================
+ Coverage 39.04% 39.33% +0.28%
==========================================
Files 60 60
Lines 9606 9610 +4
==========================================
+ Hits 3751 3780 +29
+ Misses 5767 5742 -25
Partials 88 88 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
maxlandon
added a commit
to reeflective/console
that referenced
this pull request
Jul 5, 2026
Consumes the readline-side fixes and features from v1.3.0, notably the completer panic recovery (reeflective/readline#116): readline now recovers from a panicking application completer at its own boundary, so console's completer no longer needs to guard against it. Also picks up the right-edge redraw fix, the history out-of-range fix, and the new paste-transformer and inline-suggestion APIs.
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
readline calls the application-provided
Completeron nearly every keystroke — both explicit menu completion and as-you-type autocomplete funnel throughcommandCompletion. If that user code panics (a bad completer, or transient command-tree state), the panic propagated out of the completion path and crashed the whole interactive shell.Fix
Recover around the completer invocation in
commandCompletionand surface the panic value as a completion message, so a single faulty completion degrades into a visiblecompletion error: …instead of taking down the process. Both completion paths share this one adapter, so the single choke point covers them all.Why here and not downstream
This is the readline-side fix for reeflective/console#81, which worked around the crash by recovering inside console's own completer. Fixing it in readline protects every caller — no downstream project needs to wrap its completer in a
recover(). Once this lands, console #81 can be dropped (or trimmed to just its cobra command-tree reset, which is console-specific).Testing
TestCommandCompletionRecoversFromPanic(panicking completer → recovered, message surfaced) andTestCommandCompletionNilCompleter(clean no-op).go build,go vet, andgo test ./...all pass.