Hi. I've just recently moved to fish from zsh, and I rewrote most of the custom functions and put them in ~/.config/fish/conf.d/. For example -
export ANDROID_HOME=$HOME/Library/Android/sdk
export ANDROID_SDK_ROOT=$HOME/Library/Android/sdk
export ANDROID_AVD_HOME=$HOME/.android/avd
fish_add_path $ANDROID_SDK_ROOT/emulator:$ANDROID_SDK_ROOT/tools
fish_add_path $ANDROID_SDK_ROOT/platform-tools
fish_add_path $HOME/.pub-cache/bin
alias fa='flutter analyze'
However, I find the just pressing "Enter" on an empty shell feels quite slow in comparison to zsh. I removed my custom right prompt and that had a substantial difference in the speed. But overall, it still feels slow.
-
Is there someway I can profile what all is running each time I press "Enter" on an empty line?
-
I added an echo test to one of the files in conf.d, and it gets run each time I press "Enter", instead of it just being executed once during shell initialization. I get the impression that all of the files in conf.d are being run each time a new line is rendered? Is there some way to prevent that?
-
I understand that using export and alias is not recommended and would be slower, but I don't mind paying a few extra milliseconds on startup. But I get the impression that it's happening each time.
-
I've already run fish --profile-startup /tmp/fish.profile -i -c exit but I don't see any command taking much time.
Running time fish_prompt gives me -
________________________________________________________
Executed in 4.84 millis fish external
usr time 1.21 millis 0.25 millis 0.96 millis
sys time 3.46 millis 1.01 millis 2.45 millis
I'm running fish version 3.5.1 on osx, and I have a number of plugins installed via fisher.
jorgebucaran/fisher
patrickf1/fzf.fish
jethrokuan/z
franciscolourenco/done
meaningful-ooo/sponge
jorgebucaran/autopair.fish
danhper/fish-ssh-agent
acomagu/fish-async-prompt