summaryrefslogtreecommitdiff
path: root/src/bash/_bashrc
blob: aa512c7721dbfa6db79d716bdbbc0d426e98fc1c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40

WINDOOF=$(if test -d /c/Windows; then echo true; else echo false; fi)

if test -d ~/.bin ; then
    PATH=~/.bin:$PATH
fi

# Add global node modules to path
#PATH=/opt/node-6.10.1/lib/node_modules/.bin:$PATH

# bash completion for npm (nodePackageManager)
#source /opt/node-6.10.1/etc/npm-completion.sh

# Load user scoped settings.
#source ~/.config/user/setup-env
#source ~/.config/user/setup-shell


if $WINDOOF; then

    # ssh-agent (See: https://docs.github.com/en/github/authenticating-to-github/working-with-ssh-key-passphrases#auto-launching-ssh-agent-on-git-for-windows)
    env=~/.ssh/agent.env
    agent_load_env () { test -f "$env" && . "$env" >| /dev/null ; }
    agent_start () {
        (umask 077; ssh-agent >| "$env")
        . "$env" >| /dev/null ; }
    agent_load_env
    agent_run_state=$(ssh-add -l >| /dev/null 2>&1; echo $?)
    if [ ! "$SSH_AUTH_SOCK" ] || [ $agent_run_state = 2 ]; then
        agent_start
    fi
    unset env

    # Fix vim-behind-ssh on windoof
    # TODO this fixes the remote shell, but breaks the local one (Eg del prints
    #      tilde). Grr ....
    #if test -n "$ConEmuBuild"; then TERM=dumb; export TERM; fi

fi