-
Notifications
You must be signed in to change notification settings - Fork 203
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:
reedline-insert-completions.mov
References
-
A previously reported issue (More granular config for triggering tab completions, and inserting completions #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 Event for accepting a menu item #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):fish-complete-style.mov
-
zsh --no-rcs(forgive my clumsiness, I almost never usezsh):zsh-complete-style.mov