diff options
| -rw-r--r-- | lib/functions.zsh | 10 | ||||
| -rw-r--r-- | lib/termsupport.zsh | 4 | ||||
| -rw-r--r-- | plugins/tmux-cssh/_tmux-cssh | 25 | 
3 files changed, 34 insertions, 5 deletions
diff --git a/lib/functions.zsh b/lib/functions.zsh index ec6f37214..f9d4a9717 100644 --- a/lib/functions.zsh +++ b/lib/functions.zsh @@ -16,13 +16,17 @@ function take() {  }  function open_command() { +  emulate -L zsh +  setopt shwordsplit +    local open_cmd    # define the open command    case "$OSTYPE" in -    darwin*)  open_cmd="open" ;; -    cygwin*)  open_cmd="cygstart" ;; -    linux*)   open_cmd="xdg-open" ;; +    darwin*)  open_cmd='open' ;; +    cygwin*)  open_cmd='cygstart' ;; +    linux*)   open_cmd='xdg-open' ;; +    msys*)    open_cmd='start ""' ;;      *)        echo "Platform $OSTYPE not supported"                return 1                ;; diff --git a/lib/termsupport.zsh b/lib/termsupport.zsh index 4c5068e9b..f11a7dd18 100644 --- a/lib/termsupport.zsh +++ b/lib/termsupport.zsh @@ -9,7 +9,7 @@  function title {    emulate -L zsh    setopt prompt_subst -   +    [[ "$EMACS" == *term* ]] && return    # if $2 is unset use $1 as default @@ -18,7 +18,7 @@ function title {    if [[ "$TERM" == screen* ]]; then      print -Pn "\ek$1:q\e\\" #set screen hardstatus, usually truncated at 20 chars -  elif [[ "$TERM" == xterm* ]] || [[ "$TERM" == rxvt* ]] || [[ "$TERM" == ansi ]] || [[ "$TERM_PROGRAM" == "iTerm.app" ]]; then +  elif [[ "$TERM" == xterm* ]] || [[ "$TERM" == putty* ]] || [[ "$TERM" == rxvt* ]] || [[ "$TERM" == ansi ]] || [[ "$TERM" == cygwin ]] || [[ "$TERM_PROGRAM" == "iTerm.app" ]]; then      print -Pn "\e]2;$2:q\a" #set window name      print -Pn "\e]1;$1:q\a" #set icon (=tab) name    fi diff --git a/plugins/tmux-cssh/_tmux-cssh b/plugins/tmux-cssh/_tmux-cssh new file mode 100644 index 000000000..604e2e478 --- /dev/null +++ b/plugins/tmux-cssh/_tmux-cssh @@ -0,0 +1,25 @@ +#compdef tmux-cssh + +# tmux-cssh autocompletion for oh-my-zsh +# Requires: tmux-cssh installed +# Author: Manfred Touron (@moul) + +_arguments \ +'(-h --help)'{-h,--help}'[This help.]' \ +'(-u --user)'{-u,--user}'[User to use.]' \ +'(-c --certificate)'{-c,--certificate}'[Path to ssh-certificate to use.]' \ +'(-sc --ssh)'{-sc,--ssh}'[SSH-connection-string, multiple.]' \ +'(-sa --ssh)'{-sa,--ssh}'[SSH connection arguments, used on every session.]' \ +'(-ts --tmux)'{-ts,--tmux}'[Alternative tmux-session-name, default: tmux-cssh]' \ +'(-ns --new)'{-ns,--new}'[Initializes a new session, like -ts \[name\].]' \ +'(-q --quiet)'{-q,--quiet}'[Quiet-mode.]' \ +'(-f --filename)'{-f,--filename}'[Filename of textfile to get -sc connection-strings from, line separated.]' \ +'(-cs --config)'{-cs,--config}'[Name of config-settings which should be get from config-file "$HOME/.tmux-cssh". Which can be a grep-regular expression to find the name(s).]' \ +  ':hosts:_hosts' \ +  '*:: :->subcmds' \ +  && return 0 + +if (( CURRENT == 1 )); then +    _describe -t commands "tmux-cssh command" +    return +fi  | 
