pkgxdev / pkgx

the last thing you’ll install
https://pkgx.sh
Apache License 2.0
8.81k stars 1.36k forks source link

Command not found behavior, exit faster? #1013

Open magnusviri opened 1 month ago

magnusviri commented 1 month ago

Is it possible to exit faster when a command is not found? I believe right now the current behavior is to make a web request to see if a command is on the server. I could be wrong? Instead, can pkgx keep a local cache of commands and exit without doing a web lookup? Besides the security risk of doing a web lookup if say, the user accidentally enters a password, it sends the wrong signal to pause because I keep thinking the command is actually running. Just put a message in the "not found" saying to update the pkgx cache to run pkgx --sync. If this is already the behavior then something is wrong with my terminal because it takes at least a second to run a command that doesn't exist.

> time a
cmd not found: a
a  0.77s user 1.05s system 68% cpu 2.679 total