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

Stopped working in zsh #10

Closed
rncain opened this issue Feb 19, 2019 · 10 comments
Closed

Stopped working in zsh #10

rncain opened this issue Feb 19, 2019 · 10 comments

Comments

@rncain
Copy link

rncain commented Feb 19, 2019

Something in commit b3250a9 has added something that causes an issue with zsh.

I'm running Zsh on MacOS

ok
ok:80: bad substitution
@secretGeek
Copy link
Owner

interesting. Do you have a .ok that it's trying to read?

@atlib77
Copy link

atlib77 commented Apr 8, 2019

I got the same. But works if I run it from bash. Ran it on ok-bash root directory so the .ok file is in the repo.

@AshtonIzmev
Copy link

AshtonIzmev commented Jun 7, 2019

That commit b3250a9 indeed broke zsh compatibility.

Zsh does not accept indirect expansion (but bash does) to go from a variable name to its value.
https://unix.stackexchange.com/a/119442/310341
The following line here will not work :
export "$x"="${!x}"
And there may be an issue at least on my configuration with grep that returns binary files
set | grep "^_OK_" | awk -F '=' '{print $1}')

Solved on my laptop both on zsh with the following code L92:L96
for x in $(set | grep --binary-files=text "^_OK_" | awk -F '=' '{print $1}'); do export "$x"="${(P)x}" done

Should we fork for a Zsh ? Or create a ok_zsh.sh ? Or simply patch the bash version ? (need to check bash compatibility then).
Anyway, ok is an awesome idea. Thanks

@doekman
Copy link
Collaborator

doekman commented Aug 17, 2019

I will look into this somewhere in september (because Training: moving to zsh).

I think ok-bash should work on zsh as well. Thanks for you patience.

@doekman
Copy link
Collaborator

doekman commented Sep 16, 2019

There were two cases of bad substition, and that was an easy fix. Changed export "$x"="${!x}" to export "$x" (the art of omission), see zsh-fix-branch.

However, there still are some issues.

@doekman doekman closed this as completed Jan 25, 2020
@slidesecurity
Copy link

People always ask what is "ok." I always refer them to this repo. Unfortunately, it doesn't work out of the box for most mac users because of the need to switch to the zsh branch. I think it should be merged into master if possible.

@doekman doekman reopened this Jun 21, 2022
@doekman
Copy link
Collaborator

doekman commented Jun 21, 2022

The zsh-fix branch doesn't contain something improvements anymore (I'll remove it later).

Yes, I agree zsh should work. I'll look into it when I have time (no promises).

@doekman
Copy link
Collaborator

doekman commented Jun 21, 2022

See this PR: #36

@doekman
Copy link
Collaborator

doekman commented Jun 30, 2022

Zsh support is done. Implementation of autocomplete is another issue.

Can this be tested, if you still use it? You will need to checkout the zsh-support branch.

@slidesecurity @AshtonIzmev @atlib77 @rncain

@doekman
Copy link
Collaborator

doekman commented Aug 16, 2022

Merged.

@doekman doekman closed this as completed Aug 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants