Skip to content

tmuxp completions has error when code added to ~/.zshrc #477

@OdinsHat

Description

@OdinsHat

Step 1: Provide a summary of your problem

When adding:

eval "$(_TMUXP_COMPLETE=source tmuxp)"

to ~/.zshrc it causes errors.

Step 2: Provide tmuxp details

  • Python version
  • system PATH
  • tmux version = 2.8
  • tmuxp version = 1.5.1
  • tmux path = /usr/bin/tmux
  • tmuxp path = /usr/bin/tmuxp
  • libtmux version = latest
  • shell = zsh
  • output of tmuxp freeze <SESSION_NAME>

Step 3: Describe your environment

  • Architecture: Arch Linux

Step 4: Describe the problem:

Steps to reproduce:

Take code out of file to see why I'm getting error below and run. Get bigger error shown below.

Observed Results:

1. While in zshrc

_tmuxp_completionetup:[:4: unknown condition: -gt
_tmuxp_completionetup:[:4: unknown condition: -eq

2. Run on CLI
**zsh: file name too long:** _tmuxp_completion() {\n local IFS=$'\n'\n COMPREPLY=( $( env COMP_WORDS="${COMP_WORDS[*]}" \\n COMP_CWORD=$COMP_CWORD \\n _TMUXP_COMPLETE=complete $1 ) )\n return 0\n}\n\n_tmuxp_completionetup() {\n local COMPLETION_OPTIONS=""\n local BASH_VERSION_ARR=(${BASH_VERSION//./ })\n # Only BASH version 4.4 and later have the nosort option.\n if [ ${BASH_VERSION_ARR[0]} -gt 4 ] || ([ ${BASH_VERSION_ARR[0]} -eq 4 ] && [ ${BASH_VERSION_ARR[1]} -ge 4 ]); then\n COMPLETION_OPTIONS="-o nosort"\n fi\n\n complete $COMPLETION_OPTIONS -F _tmuxp_completion tmuxp\n}\n\n_tmuxp_completionetup;

Expected Results:

ZSH autocompletions for tmuxp options and sub commands.

Relevant Code:

eval "$(_TMUXP_COMPLETE=source tmuxp)"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions