Proposal: option to insert completions immediately without "submit" keypress
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 818
- Forks
- 249
- Avg merge
- 4d 14h
- Merged PRs (30d)
- 30
Description
Hello! I've been reading various issues related to completion, in particular the many requests for "fish-like" completions.
I tried to identify the behaviors that I think would make the completion UX more fish-like, and what I came up with is this (see also reference videos below):
- Completions are inserted immediately when focused in the menu, instead of requiring confirmation
- Continuing to type anything else dismisses the completion menu, since the completion was already inserted
For users who are interested in more fish-like completions, I think an option to complete like this would make it feel a lot more "at home" (and for nushell, this in combination with external fish completion might seal the deal). I am not aware of any existing reedline options like what is described here (but please correct me if I'm wrong!).
Implementation
I've implemented a basic version of this already! It lives behind a flag like quick_completions or partial_completions. It only supports columnar menu for now, and I think it still needs some more testing and edge cases fixed, but I plan to address those changes if this proposal is accepted.
If this all seems reasonable, I'd like to contribute such a flag to reedline (and subsequently plumb it into nushell). However, I realize completions are a common area for people to make requests and implementation proposals (e.g. #993) so I wanted to make sure maintainers are onboard with this idea before opening a PR.
Here's a short video with my changes flipped on in the --example demo:
https://github.com/user-attachments/assets/f37d8e4b-27e2-4b37-a4a3-179e2e40074c
References
-
A previously reported issue (#623) mentions this, but its scope is fairly large; I'd like to focus scope to just the two behaviors mentioned above.
-
Maybe relates to #624 as well? The use case is kinda similar but it seems more like a programmatic workaround for something that I think makes more sense as builtin behavior.
-
fish --no-config(defaults):https://github.com/user-attachments/assets/e0cd566e-0c03-461d-93bf-6b6abd1c28cd
-
zsh --no-rcs(forgive my clumsiness, I almost never usezsh):https://github.com/user-attachments/assets/2f9e41bb-ed23-4be2-b194-0f9d8e22a79a
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the --example demo and review the existing completion behavior described in the issue. The proposed change is scoped to immediate insertion when a menu item is focused and dismissing the menu when typing continues; completion behavior should be tested beyond the current columnar-menu implementation before considering it done.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100