huffshell
huffshell copied to clipboard
Several speed and aliases improvements
Features in this PR:
- faster code: the
~/.aliases.cachefile 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&bfor an alias because Bash interprets it asa & b. - don’t suggest existing aliases (#3): if
gis already aliased togit, Huffshell won’t suggest you.
Feel free to ask any question about the changes here.
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.