start: forward command line args to the shell

This commit is contained in:
Fernando Schauenburg 2022-09-01 08:46:13 +02:00
parent 6ef0a61a7a
commit 0a79fc285a

View file

@ -25,10 +25,15 @@ while getopts ":wh" arg; do
exit 1
;;
esac
shift
done
if [ "$WSL_SSH_AGENT" = true ]; then
if [ "$#" -gt 0 ]; then
SHLVL=0 exec ssh-agent "$SHELL" -c "$@"
else
SHLVL=0 exec ssh-agent "$SHELL"
fi
fi
require() {
@ -46,5 +51,8 @@ require npiperelay
export SSH_AUTH_SOCK=$HOME/.ssh/agent.sock
[ -S "$SSH_AUTH_SOCK" ] && rm "$SSH_AUTH_SOCK"
socat UNIX-LISTEN:$SSH_AUTH_SOCK,fork EXEC:"npiperelay -ei -s //./pipe/openssh-ssh-agent",nofork &
SHLVL=0 exec "$SHELL"
if [ "$#" -gt 0 ]; then
SHLVL=0 exec "$SHELL" -c "$@"
else
SHLVL=0 exec "$SHELL"
fi