From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15756 invoked by alias); 31 May 2011 19:35:38 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 29412 Received: (qmail 19716 invoked from network); 31 May 2011 19:35:36 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, SPF_HELO_PASS autolearn=ham version=3.3.1 Received-SPF: none (ns1.primenet.com.au: domain at bewatermyfriend.org does not designate permitted sender hosts) From: Frank Terbeck To: zsh-workers@zsh.org Cc: Frank Terbeck Subject: PATCH: _tmux: Avoid breakages if `tmux' is not installed Date: Tue, 31 May 2011 21:24:44 +0200 Message-Id: <1306869884-28305-1-git-send-email-ft@bewatermyfriend.org> X-Mailer: git-send-email 1.7.5 X-Df-Sender: 430444 With this, _tmux will not attempt and sub-command completions if tmux is not found in `$path'. --- I'm not entirely sure if this is the right thing to do[tm]. Usually, you wouldn't expect people to try completions for programs they don't have installed, but apparently, some people do. ;-) Completion/Unix/Command/_tmux | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/Completion/Unix/Command/_tmux b/Completion/Unix/Command/_tmux index e9977fb..5fb7219 100644 --- a/Completion/Unix/Command/_tmux +++ b/Completion/Unix/Command/_tmux @@ -1520,6 +1520,10 @@ function _tmux() { _describe -t subcommands 'tmux commands and aliases' _tmux_commands -- _tmux_aliases fi else + if (( ${+commands[tmux]} == 0 )); then + _message '`tmux'\'' not found in $path; sub-cmd completions disabled.' + return 0 + fi tmuxcommand="${words[1]}" if [[ -n ${_tmux_aliasmap[$tmuxcommand]} ]] ; then tmuxcommand="${_tmux_aliasmap[$tmuxcommand]}" -- 1.7.5