PSFzf icon indicating copy to clipboard operation
PSFzf copied to clipboard

Enabling aliases is very slow

Open srid opened this issue 4 years ago • 2 comments

I add the following to my PS init script to enable aliases on all shells:

echo "Loading aliases ..."
Enable-PsFzfAliases
echo "Done."

However this slows down the shell initialization by several seconds (5s). Any way to speed things up here?

srid avatar Mar 08 '21 03:03 srid

> Measure-Command { Enable-PsFzfAliases }

Days              : 0
Hours             : 0
Minutes           : 0
Seconds           : 4
Milliseconds      : 308
Ticks             : 43080303
TotalDays         : 4.98614618055556E-05
TotalHours        : 0.00119667508333333
TotalMinutes      : 0.071800505
TotalSeconds      : 4.3080303
TotalMilliseconds : 4308.0303

srid avatar Mar 08 '21 03:03 srid

Try using Set-PsFzfOption. You need to explicitly specify which aliases you want to enable, but it should speed up load time.

Enabe-PsFzfAliases needs to do more checking to prevent clashing with exes in your %PATH%.

kelleyma49 avatar Apr 24 '21 18:04 kelleyma49