huffshell icon indicating copy to clipboard operation
huffshell copied to clipboard

Several speed and aliases improvements

Open bfontaine opened this issue 10 years ago • 1 comments

Features in this PR:

  • faster code: the ~/.aliases.cache file is now loaded only once instead of once per command. I also simplified some parts of the code and cached a few things to make it faster.
  • automatic aliases discovery for Bash and Zsh: no ~/.aliases.cache? That’s not a problem anymore.
  • no special chars in the suggestions: Huffshell shoudn’t suggest you to use a&b for an alias because Bash interprets it as a & b.
  • don’t suggest existing aliases (#3): if g is already aliased to git, Huffshell won’t suggest you.

Feel free to ask any question about the changes here.

bfontaine avatar Dec 23 '15 12:12 bfontaine

On my machine with no ~/.aliases.cache file and 12787 commands in my history the current huffshell takes ~2.3 seconds while with this PR it takes ~1.4 seconds. If the ~/.aliases.cache file exists the current huffshell takes ~0.5 seconds while with this PR it takes ~0.3 seconds.

bfontaine avatar Dec 23 '15 13:12 bfontaine