Skip to content

Commit

Permalink
Fixes #8 add bash support
Browse files Browse the repository at this point in the history
  • Loading branch information
haosdent committed Mar 3, 2015
1 parent 9780cdd commit 22bee1c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions s.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ _s() {
shift

# No start with ssh isn't worth matching
[ "${*:0:3}" != "ssh" ] && return
args=$*
[ "${args:0:3}" != "ssh" ] && return
target=$(echo $*|perl -n -e '/ +(.+)/ && print $1')

# don't track excluded hosts
Expand Down Expand Up @@ -219,7 +220,7 @@ elif complete >/dev/null 2>&1; then
[ "$_S_NO_PROMPT_COMMAND" ] || {
# populate directory list. avoid clobbering other PROMPT_COMMANDs.
grep "_s --add" <<< "$PROMPT_COMMAND" >/dev/null || {
PROMPT_COMMAND="$PROMPT_COMMAND"$'\n''_s --add "$(command pwd '$_S_RESOLVE_SYMLINKS' 2>/dev/null)" 2>/dev/null;'
PROMPT_COMMAND="$PROMPT_COMMAND"$'\n''_s --add `history 1 | sed -e "s/^[ ]*[0-9]*[ ]*//"` 2>/dev/null;'
}
}
fi

0 comments on commit 22bee1c

Please sign in to comment.