-
Notifications
You must be signed in to change notification settings - Fork 337
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
Zsh autocompletion doesn't work : COMP_LINE and COMP_POINT are empty #1028
Comments
Seems related to #1021 at first glance... |
Thanks for the answer. In which way is it related to python 3 compared to python 2? And I just saw that it's not only related to Zsh but Bash too... |
To be honest, I don't really remember much about #1021 -- the commit is from last August, which may as well be a decade ago... :] In your traceback, I noticed you installed rez with python-3.8; and my PR specifically addresses an issue where
I haven't really grokked the code beyond that, so I'm not sure what's specifically going on in zsh vs bash. |
@johhnry, is this issue still occurring for you in the latest rez release? |
Hi @zachlewis , I reinstalled
|
Hi again, I installed Rez 2.80.0 on a Centos 8 with Python 3.9 and it still doesn't work !
|
in an msys2 shell, I installed zsh, invoke zsh, and using default zsh config, installed rez and run rez-env, and I do not get any reproduction of the above stack trace. (python-3.7). |
Hi @maxnbk, It's been a long time, but the error still happens on Rez v2.112.0 Here is a reproducible environment with Docker: # Dockerfile
FROM alpine:latest
WORKDIR /home
RUN apk add --no-cache zsh python3 py3-pip git
RUN git clone --branch master --depth 1 https://github.com/AcademySoftwareFoundation/rez.git
WORKDIR /home/rez
RUN python install.py
ENV PATH="$PATH:/opt/rez/bin/rez"
RUN echo "source /opt/rez/completion/complete.zsh" > ~/.zshrc
ENTRYPOINT [ "/bin/zsh" ] Then run it:
(rez-zsh) $ rez --version
Rez 2.112.0 from /opt/rez/lib/python3.10/site-packages/rez (python 3.10)
(rez-zsh) $ rez <TAB> Traceback (most recent call last):
File "/opt/rez/bin/rez/_rez-complete", line 8, in <module>
sys.exit(run_rez_complete())
File "/opt/rez/lib/python3.10/site-packages/rez/cli/_entry_points.py", line 85, in run_rez_complete
return run("complete")
File "/opt/rez/lib/python3.10/site-packages/rez/cli/_main.py", line 191, in run
returncode = run_cmd()
File "/opt/rez/lib/python3.10/site-packages/rez/cli/_main.py", line 183, in run_cmd
return func(opts, opts.parser, extra_arg_groups)
File "/opt/rez/lib/python3.10/site-packages/rez/cli/complete.py", line 33, in command
last_word = comp_line.split()[-1]
IndexError: list index out of range |
COMP_LINE and COMP_POINT are variables set by the bash shell, not the zsh shell & is only for bash completion not zsh. |
Actually looking at AWS documentation, zsh has substitute shell functions for the ones in bash that handle completion.
|
Hi,
I just installed rez 2.72.0 (7f760bf) on a Pop!_OS 20.04 computer (
Python 3.8.6
) and I have a zsh shell with the latest Oh My Zsh installed.Steps to reproduce
I installed rez successfully with :
git clone https://github.com/nerdvegas/rez cd rez python ./install.py
Then added the paths to my
.zshrc
file :Now when I type
rez env
and press Tab, this is the error message :Source of the issue
I've looked at the problematic line and it's caused because the
COMP_LINE
andCOMP_POINT
environment variables are empty strings :However this is working by setting manually the variables :
Also I tried changing the complete function in
complete.zsh
file to this :And it gives me this when pressing TAB :
So what is going on here?
The text was updated successfully, but these errors were encountered: