- # NOTE: /usr/{local,pkg,games} are unix/bsdisms
- # XXX: PREFIX not validated, non-posix but Termux uses it, maybe others
+ # NOTE: tied arrays path and fpath already exist, but are not unique (-U);
+ # we utilize the fact that unique arrays keep the first occurrence
+ # and remove any further occurrences to check for elements from the
+ # old PATH that we did not anticipate and shift them to the front,
+ # since they are probably important to the system
+ typeset -gU path fpath
+ local -a syspath=("$path[@]")
+ # NOTE: /usr/{pkg,games} are unix/bsdisms
+ # NOTE: some systems (esp. research machines) may have multiple versions of
+ # packages installed in /opt/[pkg]/[ver]/bin or other dirs, managed
+ # with something like Environment Modules. this code does not account
+ # for this type of usage and will add all valid paths. any undesired
+ # paths can be removed using .zshenv.local.
+ # NOTE: fun non-conformant systems like Android may have fun dirs that
+ # contain binaries intended solely for the base system, and their use
+ # by other users/subsystems may cause problems. for example,
+ # /system/bin/bc on Android may be a different version of or
+ # completely different codebase compared to the Termux-installed bc.
+ # modern Termux does not add these such systems to PATH by default,
+ # but older versions/configurations might.
+ # XXX: PREFIX not validated, non-POSIX but Termux uses it, maybe others