Skip to content

fix(completions): keep menus open on no match, let cancelled pickers close and reopen - #19129

Merged
fdncred merged 2 commits into
nushell:mainfrom
kronberger-droid:fix/menu-stays-open-on-no-match
Oct 1, 2026
Merged

fdncred merged 2 commits into
nushell:mainfrom
kronberger-droid:fix/menu-stays-open-on-no-match

Conversation

@kronberger-droid

Copy link
Copy Markdown
Contributor

Description

Since #18791 every completion menu closes as soon as the typed text matches nothing, with persistent_menus on too (#19096).
SourcedMenu::abandon_if_empty closes on any settled empty answer, and #18791 wrapped the default columnar and ide menus in it as well.
The abandon exists for cancelled pickers: an @interactive completer or menu source cancelled with Esc answers empty, and an open empty menu would relaunch it on the next keystroke.
A cancelled picker is always the first answer after activation though, while typing past all matches comes after the menu has shown values.
So SourcedMenu now remembers whether it has shown values since the last Activate, and only abandons when the first answer is empty.

Testing the picker path turned up two older bugs, both also on main:

  • Stray indicator. With quick off, the opening can_partially_complete probe is the first fetch, but the wrapper skipped the abandon check there. The menu only closed on the next repaint, after the prompt had drawn its indicator, so a | stayed until the next keypress. The probe now checks too; a probe that fetched nothing is still covered by is_awaiting_first_answer.
  • Picker would not reopen. NuCompleter kept the cancelled picker's empty answer in latest, so Tab on the same line served it again instead of running the picker. Interactive answers are now kept only when non-empty, which still dedupes the repeated asks of one keystroke.

User-facing changes (Release notes)

Completion menus stay open when nothing matches

An open completion menu no longer closes when the typed text stops matching.
It shows NO RECORDS FOUND and fills again once the text matches, as it did before 0.116.
Cancelling an @interactive picker with Esc now closes its menu right away, and Tab on the same line opens the picker again.

Additional notes

fixes #19096

@fdncred
fdncred merged commit 1f2dd1f into nushell:main Oct 1, 2026
15 checks passed
@github-actions github-actions Bot added this to the 1.0 milestone Oct 1, 2026
@fdncred

fdncred commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Thanks for stepping in and putting this up

@fdncred fdncred added A:completions Issues related to tab completion notes:fixes Noted in "Bug fixes" section notes:ready Indicates Ready for Release notes labels Oct 1, 2026
@kronberger-droid
kronberger-droid deleted the fix/menu-stays-open-on-no-match branch October 1, 2026 11:34
@cptpiepmatz cptpiepmatz modified the milestones: 1.0, v0.117.1, v0.116.1 Oct 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A:completions Issues related to tab completion notes:fixes Noted in "Bug fixes" section notes:ready Indicates Ready for Release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Completion menus close when the typed text matches nothing (regression since #18791)

3 participants