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

Option to disable online lookups for speed? #1065

Open
chmac opened this issue Dec 23, 2024 · 9 comments
Open

Option to disable online lookups for speed? #1065

chmac opened this issue Dec 23, 2024 · 9 comments

Comments

@chmac
Copy link

chmac commented Dec 23, 2024

I've enabled shell integration. When I mistype a command, and press enter, it looks like pkgx is doing some kind of http request to tell me ^^ type `x` to run that, because it takes a heck of a long time. At least a second or two. Certainly long enough to slow me down such that I'm caught waiting for it to finish and end up hitting ctrl-c to stop it.

Is there an option to turn that off? Personally, I don't need the "hey this can be run from pkgx" or not on a given command. I would much prefer the speedup over the notice. If this option doesn't exist yet, could this issue become a feature request?

PS> pkgx is really great, thanks to all the folks who make it happen.

@felipecrs
Copy link
Contributor

This is indeed happening, but I think it's a bug.

It was not supposed to sync every time, only sometimes when there is no cache or cache is too old.

@mxcl
Copy link
Member

mxcl commented Jan 4, 2025

It syncs if the command is not known since maybe the command is newer than what we have cached.

I agree it’s annoying.

What shellcode do you use? I am reconsidering what is the default for v2

@felipecrs
Copy link
Contributor

ZSH.

It may be a false memory, but I don't remember it being a problem some versions ago. Maybe it's the sync operation that is taking longer.

@chmac
Copy link
Author

chmac commented Jan 5, 2025

I'm also on zsh. And you're right, it doesn't always seem to be slow. But I'd be very happy to turn the whole thing off, I really don't want to"advertising" in my shell. To be completely honest, it has me considering dropping pkgx from our recommended toolset, between the very noticeable delay and the constant "hey, use me, use me" it makes it hard to recommend the tool as part of our dev process.

@mxcl
Copy link
Member

mxcl commented Jan 8, 2025

Sorry by shellcode, I mean the pkgx features that you use that are available due to having eval "$(pkgx --shellcode)" in your shell rc files.

@mxcl
Copy link
Member

mxcl commented Jan 8, 2025

To be completely honest, it has me considering dropping pkgx from our recommended toolset, between the very noticeable delay and the constant "hey, use me, use me" it makes it hard to recommend the tool as part of our dev process.

The shellcode is optional. Recommend they don’t use it? Edit: well I guess you are using dev? In v2 this is a separate tool and at this point I am not porting the command-not-found handler pieces because overall I didn’t find them useful enough. More irritating. It was meant to be a useful feature, it's disheartening to hear it came across as “advertising” :/

All the same the rust port is almost complete and it doesn’t have this issue. Look out for v2.

@felipecrs
Copy link
Contributor

Wow. You have been busy. Looking forward to it.

@chmac
Copy link
Author

chmac commented Jan 8, 2025

Edit: well I guess you are using dev? In v2 this is a separate tool and at this point I am not porting the command-not-found handler pieces because overall I didn’t find them useful enough. More irritating.

Yeah, I'm using dev. If there was a command to be able to run whatever is the default for a directory, without having to use dev all the time, that would be great for us. I only use dev because I can automate the versions. But if I could cd into the directory and run pkgx to load all the defaults for that dir, then I wouldn't need dev at all.

Anyway, I'm getting off topic. We'll hold out for v2. In case my view comes off as negative, overall I really like pkgx. It makes getting team members started so much easier. That's really the key use case for us, run one command, have all the dependencies and so on you need to get started, and at the correct versions. 🧡

@mxcl
Copy link
Member

mxcl commented Jan 8, 2025

But if I could cd into the directory and run pkgx to load all the defaults for that dir, then I wouldn't need dev at all.

With pkgx v2 and the separate dev tool you would be able to do this with source <$(pkgx dev) which is all typing dev with the shellcoded loaded does. Right now I believe you could do it with source <(pkgx --internal.activate) but it's a while since I’ve been there.

The dev shellcode isn’t much (for both v1 and v2), it just looks for cd events and adds environment.

pkgx v2 should be soonish. Not much left on my todo.

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

3 participants