facebook / PathPicker

PathPicker accepts a wide range of input -- output from git commands, grep results, searches -- pretty much anything. After parsing the input, PathPicker presents you with a nice UI to select which files you're interested in. After that you can open them in your favorite editor or execute arbitrary commands.
https://facebook.github.io/PathPicker/
MIT License
5.12k stars 283 forks source link

FPP is really slow if your zsh config takes a while to load #301

Open spatten opened 5 years ago

spatten commented 5 years ago

When I run fpp there's a 3 second pause between me selecting what file I want to open and the file actually opening in my editor. My editor is an already running emacs daemon, so it should be super fast to open a file.

I'm also running zsh as my shell.

It took me a while to figure out, but the root cause is that fpp is starting up a new instance of zsh with the -i flag, and that my .zshconfig is really big and takes a while to load.

If I edit the fpp script and comment out these lines, then the pause goes away (and everything still works just fine):

if [ -z "$VIMRUNTIME" -a "$NONINTERACTIVE" = false ]; then
  IFLAG="-i"
fi

So this is mostly my fault -- I have too much config in my .zshrc and it takes a long time to load -- but everything works for me without the -i flag being passed to zsh. I'm assuming that there are use cases where the -i flag is necessary, but this might be causing tons of people to think that fpp is slow to open.

Would it be possible to set an env variable or something so that the -i flag is never passed to zsh, or to not use the -i flag by default?

pcottle commented 5 years ago

Yeah I’m fine with an environment variable to turn that part off. We have a ton of these env variables but whats one more 😝

I do remember it being necessary to start up a new instance of the shell to accomplish certain workflows…

From: Scott Patten notifications@github.com Reply-To: facebook/PathPicker reply@reply.github.com Date: Saturday, May 11, 2019 at 12:21 PM To: facebook/PathPicker PathPicker@noreply.github.com Cc: Subscribed subscribed@noreply.github.com Subject: [facebook/PathPicker] FPP is really slow if your zsh config takes a while to load (#301)

When I run fpp there's a 3 second pause between me selecting what file I want to open and the file actually opening in my editor. My editor is an already running emacs daemon, so it should be super fast to open a file.

I'm also running zsh as my shell.

It took me a while to figure out, but the root cause is that fpp is starting up a new instance of zsh with the -i flag, and that my .zshconfig is really big and takes a while to load.

If I edit the fpp script and comment out these lines, then the pause goes away (and everything still works just fine):

if [ -z "$VIMRUNTIME" -a "$NONINTERACTIVE" = false ]; then

IFLAG="-i"

fi

So this is mostly my fault -- I have too much config in my .zshrc and it takes a long time to load -- but everything works for me without the -i flag being passed to zsh. I'm assuming that there are use cases where the -i flag is necessary, but this might be causing tons of people to think that fpp is slow to open.

Would it be possible to set an env variable or something so that the -i flag is never passed to zsh, or to not use the -i flag by default?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/facebook/PathPicker/issues/301, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AAIVDHZQK34MEX6GKTVTLZTPU4MCRANCNFSM4HMI2KMQ.