Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Command not found behavior, exit faster? #1013

Open
magnusviri opened this issue Jun 4, 2024 · 1 comment
Open

Command not found behavior, exit faster? #1013

magnusviri opened this issue Jun 4, 2024 · 1 comment

Comments

@magnusviri
Copy link
Contributor

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
@mxcl
Copy link
Member

mxcl commented Sep 6, 2024

Yes with shell integration we check remotely to see if the command can be found which indeed is slow and kinda naughty. We don't send the command you typed tho. We --sync so not insecure at least.

This facilitates the type \x` to run that` behavior for the case where the command is not known locally.

Could make this optional or something more clever.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants