zsh: no actually we need to do this properly

This commit is contained in:
Erin 2023-07-19 23:11:57 -04:00
parent 166fc85d47
commit dac421f56b

View file

@ -2,9 +2,11 @@
# processes of this shell and checking for things like sshd/tailscaled. Runs # processes of this shell and checking for things like sshd/tailscaled. Runs
# first because multiple other things rely on this. # first because multiple other things rely on this.
is_remote="" declare -a is_remote
proctree="$(pstree -s $$)" is_remote=()
echo "$proctree" | grep "sshd" && is_remote="$is_remote sshd"
echo "$proctree" | grep "tailscaled" && is_remote="$is_remote tailscaled"
[ -n "$is_remote" ] && export IS_REMOTE_SESSION="$(echo $is_remote | xargs)" proctree="$(pstree -s $$)"
[[ "$proctree" =~ sshd ]] && is_remote+=sshd
[[ "$proctree" =~ tailscaled ]] && is_remote+=tailscaled
[ -n "$is_remote" ] && export IS_REMOTE_SESSION="$is_remote[@]"