* shell config is created with CRLF https://github.com/microsoft/inshellisense/issues/8
* changing directory doesn't work https://github.com/microsoft/inshellisense/issues/5
Type/command aware tooling is a night and day difference.
What is sad is that it has to rely on a library of completion specs. It shows what kind of stone age foundations we are building on top of. The world would have been a much better place if CLIs themselves defined strict interfaces using standard data structures. Not only for auto completion, also gives much more accurate error checking of bash scripts. Same goes for data piped in and out of command.
It would thoroughly dispense with the whole argument parsing routine in the first place, which could now be done in a standardised manner; arguments could be defined as strict types with possible values limited to a set, and best of all, they wouldn't just be a dictionary/hash-map of strings to strings—the arguments could actually be named variables with values, in the context of the called utility.
It would certainly be quite a powerful shell, and I'm sure something similar has already been done. I just can't think of an example..... A Powerful shell, running on some Common Language Runtime; I wonder what it could be.
Well it's not too late just yet.
How about if all CLI exes had an option, say --dump-cli-options, that wrote out a spec of the supported commands/flags/options?
Something like e.g. Python's argparse should be able to effortlessly spit out this info (and the same for other similar argument parsing libraries).
This could be used to do "form validation" of CLI args as they're typed in the shell.
Hard pass
> npm install
NEXT!
This reuses Fig.io's internal completion engine to actually get the job done.
Because of that, it forces the language choice of Typescript, and the heavy lift is done by Fig's engine.
I hope the OP continues with the work and improves it. I was looking forward to trying Fig on Linux. This sounds like a step towards that.
From there, :wq will drop the text back into your command line. If you have Copilot set up in either of those, then it will also work here.
I know from working on https://github.com/hiAndrewQuinn/shell-bling-ubuntu that Neovim's LazyVim setup now supports Copilot out of the box now. I never had much trouble setting up the Vim plugin either. YMMV.
zsh starts minimal, so one needs the following for such a feature to be operational:
# enable
autoload edit-command-line
zle -N edit-command-line
# bash-like emacs mode shortcut
bindkey "^X^E" edit-command-line
# bash-like vi mode shortcut
bindkey -M vicmd v edit-command-lineIt’s really cool to see alternative implementations of IDE-style autocomplete in the terminal. Nice work!
I half wonder if the author checked the name first, then started coding......
Keen to see how this pans out though!
zsh 5.9 (x86_64-apple-darwin22.0)
There’s Copilot CLI coming soon[0] but I think something that autocompletes would feel more natural most of the time.
Too bad…
This also enables shell-aware LLM prompting!
I recall disabling bash_completion.sh on my computer some time ago due to its negative impact on the startup speed of each iTerm2 session and the delay it introduced when using the <TAB> key for autocompletion.
Before I disabled this feature, I consistently experienced delays of over 300ms between triggering autocomplete and receiving the actual results. I must admit that this was on an Intel Core i7, so I assume the performance is much better with newer processors. However, even after more than two years without bash_completion.sh, I have already committed many command line tool flags to memory so I would only consider using a tool written in a compiled programming language that can provide autocomplete in 100ms or less, potentially requiring the inclusion of hardcoded information in the binary.
I wish those aboard the TS/JS hate-train knew what they were even complaining about.
Yes, and that's what people are complaining about. People use the wrod typescript in this thread because, well, it's what shows up on github, but the same argument would come up if it was in pure js.
People have problem with the fact that you are running a nodejs for the terminal enhancement, not what language it uses
I won’t dispute this statement since I currently lack the means to assess inshellisense. Would it be possible for you (or someone with a functional Node + NPM setup) to install inshellisense and share the actual performance figures? You could use a tool like hyperfine (https://github.com/sharkdp/hyperfine) for this purpose.
As an attempt to test this myself, I used a Docker image (version 21.1.0-bookworm from https://hub.docker.com/_/node/). The TypeScript tool installed without any issues, along with the binding, which simply adds the following line into ~/.bashrc:
[ -f ~/.inshellisense/key-bindings.bash ] && source ~/.inshellisense/key-bindings.bash
However, when I initiated a new Bash session within the same Docker container to activate the updated Bash configuration, I encountered the following error: bash: /root/.inshellisense/key-bindings.bash: line 1: syntax error near unexpected token `$'{\r''
'ash: /root/.inshellisense/key-bindings.bash: line 1: `__inshellisense__() {
Due to this issue, I am unable to perform a performance test using hyperfine.The version of Bash available in this Docker image is 5.2.15(1)-release.
I verified that the content of /root/.inshellisense/key-bindings.bash is exactly the same as https://github.com/microsoft/inshellisense/blob/main/shell/k...
I'm not some extreme purist that thinks everything should be made in C and then hand optimized in assembly, but Jesus, how wasteful can You get before the slightest amount of self awareness starts to kick in.
And for what reason, to save a week of engineering time learning GOlang?
From a quick peek, carapace-bin supports more shells (including and powering the one I use, nushell).
Because otherwise requiring `npm` as a package manager for those of us who don't develop in either is silly.
(Yes, I know npm also implies JavaScript as a runtime environment, still nope)
is inshellisense for average users like me or more advanced users?
Ctrl r is okay and it is a very convenient if you already typed the command.
Inshellisense seems to help with knowing what subcommands, flags and file paths are available, and it even provides a small docs helper for the flags and commands.
If you didn't try these tools, I'd encourage you take a look, it helped me a lot, especially when I work with tools whose commands I don't know by heart or used a while ago.
Coming next: auto-complete for punch cards.
If you wouldn't mind reviewing https://news.ycombinator.com/newsguidelines.html and taking the intended spirit of the site more to heart, we'd be grateful.