★ wanayoo — archive 1999 https://github.com/tmux-python/tmuxp/issues/477Nouvelle recherche | Portail wanayoo
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
OdinsHat opened this issue Feb 25, 2019 · 1 comment
Closed

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

OdinsHat opened this issue Feb 25, 2019 · 1 comment

Comments

@OdinsHat
Copy link

@OdinsHat OdinsHat commented Feb 25, 2019

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)"
@ikirudennis
Copy link
Contributor

@ikirudennis ikirudennis commented Mar 15, 2019

I had the same issue, and found this gem in the click documentation. So, eval "$(_TMUXP_COMPLETE=source_zsh tmuxp)" solves the problem for me.

@jubnzv jubnzv mentioned this issue Apr 25, 2019
@tony tony closed this in #483 May 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

2 participants
You can’t perform that action at this time.