Skip to content

Instantly share code, notes, and snippets.

@dustinlacewell
Created September 11, 2020 20:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dustinlacewell/dd6c579b8199ed4985aaf930483a0c01 to your computer and use it in GitHub Desktop.
Save dustinlacewell/dd6c579b8199ed4985aaf930483a0c01 to your computer and use it in GitHub Desktop.
# this prevents nested rangers
ranger() {
    if [ -z "$RANGER_LEVEL" ]; then
        exec command ranger < $TTY > $TTY 2>&1
    else
        exit
    fi
}

zle -N ranger
bindkey '^[[24~^[[24~' ranger


if [ -n "$RANGER_LEVEL" ]; then
  TRAPINT() {
    kill $PPID
  }
  trap "pwd > /tmp/rangershelldir-$USER" EXIT
fi
map <F12><F12> rangershell $SHELL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment