This commit is contained in:
David Tomaschik
2026-04-21 15:59:38 -07:00
parent fec16225e4
commit db2c02bd2d
27 changed files with 150 additions and 55 deletions

View File

@@ -1,5 +1,11 @@
function dumpenv {
tr '\0' '\n' < /proc/${1}/environ
if [ "$(uname)" = "Linux" ]; then
tr '\0' '\n' < /proc/${1}/environ
elif [ "$(uname)" = "Darwin" ]; then
# macOS doesn't have /proc, use ps instead.
# Note: this may truncate if environment is very large.
ps -p ${1} -wwwe -o command= | tr ' ' '\n' | grep '='
fi
}
if test -x "/sbin/starship" ; then