Live data from Hacker News

Show HN: Inshellisense – IDE style shell autocomplete

github.com

61–70 of 161 posts

Re: Show HN: Inshellisense – IDE style shell autocomplete

#63

Is this fully local? I glanced around and didn't see any mention of chatgpt/gpt/codex so I'm thinking it is?

There is really not much code to speak of, and a quick perusal didn't yield anything sus. Initial guess is that it's not very efficient, but I really didn't look that closely.

Autocomplete is fast but I/O is really crummy.

Re: Show HN: Inshellisense – IDE style shell autocomplete

#64

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…

This was the first thing I noticed, too. Why TypeScript? Is it: a) efficient enough, esp. compared to a Bash/Zsh/PWSH alternative, that spawning a JS interpreter for each autocomplete is no biggie? Is b) TypeScript just much more efficient than I thought? Or c) is TypeScript Microsoft's hammer, and everything looks like a nail?

It really doesn’t make any sense here. What are we making type safe exactly?

Re: Show HN: Inshellisense – IDE style shell autocomplete

#65
post #51
post #47

Earlier quoted context omitted.

Note: Normal shells use glob(7) expressions, not regular expressions.

You know I googled this immediately after I posted it, and you're absolutely right, but a good chunk of the syntax still kind of looks like regular expressions so I don't think I was too far off!

Regular expressions and glob(7) expressions look superficially similar, but it is mostly an illusion; they both use * and ? as common metacharacters, but both of those characters mean different things in the two systems. Only the [ and ] characters are used more similarly, but even those have their differences. The two syntaxes only have one common function which functions identically in the two systems, but it is invoked by different characters; specifically the ? (question mark) character in glob(7) exactly corresponds to the . (full stop) character in regular expressions.

Re: Show HN: Inshellisense – IDE style shell autocomplete

#66
Beyond the not-using-typescript for CLI tooling difference, it would be interesting for a comparison against carapace-bin, another shell agnostic completer: https://github.com/rsteube/carapace-bin (written in Go, since this thread includes other discussion about the choice of typescript for Inshellisense).

From a quick peek, carapace-bin supports more shells (including and powering the one I use, nushell).

Re: Show HN: Inshellisense – IDE style shell autocomplete

#67
post #25

Earlier quoted context omitted.

Generally, a destructive shell command prompts for approval. But I suppose overfumbly fingers could still cause grief. Type/command aware tooling is a night and day difference.

Generally? Do you have examples in mind? The ones I think of are destroy first and ask questions only if told to do so: mv cp rm redirection tee

Yeah, you’re right. I was thinking of overly destructive commands eg. reformat etc.

Re: Show HN: Inshellisense – IDE style shell autocomplete

#68

Great idea! Also terrifying :) Given how often I accidentally commit the wrong text in vscode, I shudder to think of the damage I could do with this on my shell, hah! What safety measures are there/could there be?

I don't know how painful it would be, but I think I could adapt to a short delay of maybe 50-100ms where the shell won't respond to Return presses, only after accepting a completion. Just long enough ideally to make me re-read what I entered.

Re: Show HN: Inshellisense – IDE style shell autocomplete

#69
post #57

Earlier quoted context omitted.

Exactly, which is why we check for ourselves instead of expecting it to hold our hand. Unixy tools tend do what you tell them, nothing more and nothing less. No confirmations, no output if successful, no progress bars, etc. That's a feature in my mind, but I can see how it is easy to have your day ruined if you're expecting it to ask you again.

I mostly agree, but sometimes I wish that `rm` would have default to "confirm before destroying", and add a flag like `-y` to not prompt, more or less like how `apt` works on Ubuntu.

rm can do that... set an alias to ask to confirm every time.

Re: Show HN: Inshellisense – IDE style shell autocomplete

#70
post #69
post #57

Earlier quoted context omitted.

I mostly agree, but sometimes I wish that `rm` would have default to "confirm before destroying", and add a flag like `-y` to not prompt, more or less like how `apt` works on Ubuntu.

rm can do that... set an alias to ask to confirm every time.

That's fine on my computer, but if I'm logging into a server I'm not going to do that every time.
Post reply on HN