-
Notifications
You must be signed in to change notification settings - Fork 2
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
Add Zsh support #6
Conversation
Implement the necessary hook for Zsh shell support.
👍 for extending zsh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm... something is wonky here.
I installed zsh
in a Docker for testing:
94b373fb3634# zsh --version
zsh 5.4.2 (x86_64-ubuntu-linux-gnu)
Envprobe in itself works (after installing Python, of course), as in the configuration tool and such works, and the control file is emitted, however this line in particular which I understand should make the shell run the hook is not executed automatically.
root@94b373fb3634:~# zsh
Envprobe loaded successfully. :)
94b373fb3634# ep %
94b373fb3634# ep SOME_VAR=Value
94b373fb3634# echo $SOME_VAR
94b373fb3634# ep +PATH /Envprobe
94b373fb3634# which envprobe.py
envprobe.py not found
94b373fb3634# cat /tmp/.envprobe.$$-*/control.sh
export SOME_VAR=Value;
export PATH=/Envprobe:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin;
94b373fb3634# echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
94b373fb3634# echo -e "This isn't working??\n\n"
This isn't working??
94b373fb3634# __envprobe
94b373fb3634# ep %
! Modified: PATH
added /Envprobe
+ Added: SOME_VAR
value: Value
94b373fb3634# which envprobe.py
/Envprobe/envprobe.py
Is there something extra that needs to be installed, or added to .zshrc
, e.g. some configuration toggle that allows such hook commands to be run?
My test install ran in a docker with the following directives, so it's as plain as possible.
FROM ubuntu:18.04
RUN apt-get update && apt-get install --no-install-recommends git python3 zsh
RUN cd / && git clone http://github.com/gamesh411/envprobe.git Envprobe && cd Envprobe && git checkout zsh-support
COPY zshrc /root/.zshrc # Copy the ZSHRC contents in the README.
Did you try @gamesh411's on a live (or test) environment? I wish to know if only I'm messing something up, or the patch is fishy... |
The previous solution presupposed oh-my-zsh being present and already declaring precmd_functions as an array. The current solution does not do this, and it works with or without oh-my-zsh being used.
I have tested this updated solution with zshusers/zsh docker container image, which contains stock zsh (without oh-my-zsh), and I have also tested it with my environment (which does contain oh-my-zsh). |
I have also reproduced the feasibility of the solution using this configuration:
zshrc:
|
Thank you @gamesh411 it worked now on a clean install too. 😋 |
Implement the necessary hook for Zsh shell support. Fixes #7.