diff options
author | ridiculousfish <corydoras@ridiculousfish.com> | 2013-02-01 17:18:12 -0800 |
---|---|---|
committer | ridiculousfish <corydoras@ridiculousfish.com> | 2013-02-01 17:18:12 -0800 |
commit | cd276030c16896e0da4f0bec66f6eb1f36342f63 (patch) | |
tree | 513f407cf59be289244adb28f0b6c36f21655463 /share/config.fish | |
parent | 818533f9f01887e6a546fef113727a731bc59892 (diff) |
Tweak config.fish to only modify PATH once, for performance
Diffstat (limited to 'share/config.fish')
-rw-r--r-- | share/config.fish | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/share/config.fish b/share/config.fish index af2e15cb..9e9be3e4 100644 --- a/share/config.fish +++ b/share/config.fish @@ -71,14 +71,20 @@ switch $USER set path_list $path_list /sbin /usr/sbin /usr/local/sbin end +# +# It's desirable to only modify PATH once, because fish will check it for validity, +# which performs disk I/O. Construct the new PATH locally. +# + +set -l path_under_construction $PATH for i in $path_list - if not contains $i $PATH - if test -d $i - set PATH $PATH $i - end + if begin ; not contains $i $path_under_construction ; and test -d $i ; end + set path_under_construction $path_under_construction $i end end +set PATH $path_under_construction + # # Launch debugger on SIGTRAP # |