Live data from Hacker News

Show HN: Inshellisense – IDE style shell autocomplete

github.com

131–140 of 161 posts

Re: Show HN: Inshellisense – IDE style shell autocomplete

#131

I wish they had written inShellisense in a more efficient programming language than TypeScript. 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 key for autocompletion. Before I disabled this feature, I consistently experienced delays of over 300ms between triggering autocomplete and rec…

Don’t bring TypeScript into this. It is very possible to write sub 100ms procedures in TS, but an inelegant algorithm will be slow in any language, eventually.

JavaScript doesn't belong in the shell, thanks.

Re: Show HN: Inshellisense – IDE style shell autocomplete

#132
post #130

This is cool. 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.

> The world would have been a much better place if CLIs themselves defined strict interfaces using standard data structures.

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).

Re: Show HN: Inshellisense – IDE style shell autocomplete

#133
Alternatively, if you simply wish to occasionally bring Copilot into your shell, you should know that Ctrl+X Ctrl+E (on bash) / Alt+E (on fish) will open your current shell line up in $EDITOR, which you may set to Vim or Neovim.

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.

Re: Show HN: Inshellisense – IDE style shell autocomplete

#134
post #132
post #130

This is cool. 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.

> The world would have been a much better place if CLIs themselves defined strict interfaces using standard data structures. 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 parsi…

And we would also need an options that does CLI argument parsing only, and either returns an error related to parsing one or more options or "ok".

This could be used to do "form validation" of CLI args as they're typed in the shell.

Re: Show HN: Inshellisense – IDE style shell autocomplete

#136

Alternatively, if you simply wish to occasionally bring Copilot into your shell, you should know that Ctrl+X Ctrl+E (on bash) / Alt+E (on fish) will open your current shell line up in $EDITOR, which you may set to Vim or Neovim. 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/hiAndrewQ…

If using bash in vi mode instead of emacs mode: ESC v.

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-line

Re: Show HN: Inshellisense – IDE style shell autocomplete

#137
post #130

This is cool. 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's sad. If the world of software had better coordination and cooperation, we would be able to get so much more done. Instead we're constantly dumping and re-parsing the same data, re-implementing the same protocols and algorithms in dozens of different languages, each time with different quirks. Fixing the same bugs again and again.

Re: Show HN: Inshellisense – IDE style shell autocomplete

#138
post #137
post #130

This is cool. 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's sad. If the world of software had better coordination and cooperation, we would be able to get so much more done. Instead we're constantly dumping and re-parsing the same data, re-implementing the same protocols and algorithms in dozens of different languages, each time with different quirks. Fixing the same bugs again and again.

All we need is something that will tell us who is right and then impose that vision on everyone.

Re: Show HN: Inshellisense – IDE style shell autocomplete

#140
post #26

Earlier quoted context omitted.

I feel like I've trashed millions of files I shouldn't have with `rm` and trying to be clever with regular expressions.

I've done this enough times I use `ls` first, then `rm`

I set up hourly borg backups instead. That resulted in me aliasing rm='rm -rf' without a worry in the world. So far, I made about ten recoveries and have never lost important data.
Post reply on HN