Home Explore Blog CI



nushell

4th chunk of `blog/2021-09-14-nushell_0_37.md`
848d2cf1e0ad1f6d63f0fc5262df85d35e3947c05f1ecf100000000100000439


A big motivator for the rewrite was to make it easier to add dynamic custom completions, like the kind you use when completing a git branch while doing `git checkout`. The above gif shows a very early prototype of how we might implement this using the engine-q system. It works by running actually nushell code at completion time, getting the list of git branches as a list, and handing that list back to the completion system.

The demo took less than two hours to implement using the capabilities of the new engine, and we're excited to see how we can make this more general and offer the ability for folks to create their own completions in nushell code.

# Looking ahead

Engine-q offers some huge improvements to both the internals of Nushell as well as a way to finally check off tasks we know we've wanted for a long time (like git completions). If you're interested in helping out with the engine-q work, we'd love to have the help. The best place is to join us on the discord and on the engine-q repo.

Title: Engine-q and Dynamic Custom Completions
Summary
The engine-q rewrite is motivated by the desire to add dynamic custom completions, like completing git branches during `git checkout`. A prototype shows how Nushell code can run at completion time to get git branches and provide them to the completion system. This demo took less than two hours to implement with the new engine. Engine-q offers significant improvements, including git completions, and contributions are welcome on Discord and the engine-q repo.