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

zsh error #12

Open
dvolgyes opened this issue Nov 30, 2022 · 5 comments
Open

zsh error #12

dvolgyes opened this issue Nov 30, 2022 · 5 comments
Assignees
Labels
feature Something that is not implemented yet

Comments

@dvolgyes
Copy link

Hi,

Great project. I started to play with it, and seems to work well in bash, but it fails immediately in Zsh.

> genv activate                     
_genv_backup_env:2: bad substitution

Probably you used a bash-specific idiom which doesn't work in Zsh.

As a generic advice, maybe running shellcheck could give you improvement ideas:
https://github.com/koalaman/shellcheck

@razrotenberg
Copy link
Contributor

Hi @dvolgyes and thanks for pointing it out!

We are aware of this issue.
This is because of the way we create some of the environment variables and especially because we use ! in parameter substitution here which is supported in bash but not in zsh where it's (P) instead.

For now, Genv officially supports only bash, and supporting more shells is for sure a task that needs to be done.
Also, zsh is probably the first one to add support to.

I have some poc of zsh support. I will see if I can make it work, I will create a branch and update you so that you could git checkout this branch and try it yourself.

What I recommend you is to use bash in the meantime and you can do it by running exec bash for example.

@razrotenberg razrotenberg self-assigned this Nov 30, 2022
@razrotenberg razrotenberg added the feature Something that is not implemented yet label Nov 30, 2022
@razrotenberg
Copy link
Contributor

Hi again @dvolgyes !

I published the branch with zsh support (feature/zsh).
I want to test it better before merging it to master.

Until then, you should checkout this branch in order to work with your zsh setup.
To do this, open your terminal and run the following:

cd ~/genv
git pull
git checkout feature/zsh

You should probably restart your shell for it to take effect.

It'd be great if you could use it in your zsh setup and provide feedback if it works properly or if something is not working right 🙃

@dvolgyes
Copy link
Author

dvolgyes commented Dec 1, 2022

Hi @razrotenberg ,

Thanks. I will try, but I am a bit busy with end of year deadlines, so I don't promise regular updates.
But I will try my best.

@razrotenberg
Copy link
Contributor

Hi @dvolgyes ,

Have you had some time to try the zsh support?

@varungupta31
Copy link

@razrotenberg I am trying but am getting the same error,

I created an env following the quickstart guide,

genv activate --name quick-start

Error

_genv_append_to_env:3: bad substitution

on

zsh 5.8.1 (x86_64-ubuntu-linux-gnu)

However, shifting to bash worked.

Also, while I'm at it - is there no concept of removing/deleting the environments?

genv --help didn't help in this regard, and the documentation also doesn't seem to mention anything around this? Am I missing something?

I have these now and don't know how to get rid of them.

(genv) (base) atom@atom:~$ genv envs
ID      USER            NAME            CREATED              PID(S)
78262   atom(1000)      quick-start     13 minutes ago       78262 78262 78262 78262
113516  atom(1000)      quick-start     1 minute ago         113516

kill <pid> doesn't seem to work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Something that is not implemented yet
Projects
None yet
Development

No branches or pull requests

3 participants