Skip to content

fix: Clear auto-suggestion menu list when no completions match (backport)#1632

Merged
gnodet merged 1 commit intojline-3.xfrom
fix/auto-menu-list-clear-3.x
Feb 19, 2026
Merged

fix: Clear auto-suggestion menu list when no completions match (backport)#1632
gnodet merged 1 commit intojline-3.xfrom
fix/auto-menu-list-clear-3.x

Conversation

@gnodet
Copy link
Member

@gnodet gnodet commented Feb 18, 2026

Summary

Backport of #1631 to jline-3.x.

Test plan

  • Cherry-pick applies cleanly
  • Reader module builds and tests pass

When AUTO_MENU_LIST and autosuggestion are enabled, the completion menu
stayed visible even after the user typed characters that eliminated all
matching candidates. The root cause was in clearChoices(), which called
doList() with an empty candidate list. Since doList() returns early at
the possibleSize == 0 check without clearing the post field, the stale
completion menu lambda remained set and continued to render the old
candidates on every redisplay.

Fix clearChoices() to directly set post = null instead of delegating to
doList(), which correctly removes the completion display when there are
no matching candidates.

Fixes #1338
@gnodet gnodet modified the milestones: 4.0.0, 3.30.7 Feb 19, 2026
@gnodet gnodet merged commit 9c44897 into jline-3.x Feb 19, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments