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

POSIX sh support #42

Closed
emersion opened this issue Mar 18, 2020 · 2 comments · Fixed by #43 or #46
Closed

POSIX sh support #42

emersion opened this issue Mar 18, 2020 · 2 comments · Fixed by #43 or #46

Comments

@emersion
Copy link

Would be nice to have POSIX sh support instead of just Bash. Would allow people to use zoxide on a wide variety of shells.

The Bash init script doesn't seem too far from being POSIX.

@cole-h
Copy link
Contributor

cole-h commented Mar 18, 2020

ShellCheck reports the following:

In posixify line 16:
        result="$(zoxide query $@)" || return "$?"
                               ^-- SC2068: Double quote array expansions to avoid re-splitting elements.


In posixify line 19:
                _z_cd "${result:7}" || return "$?"
                       ^---------^ SC2039: In POSIX sh, string indexing is undefined.

For more information:
  https://www.shellcheck.net/wiki/SC2068 -- Double quote array expansions to ...
  https://www.shellcheck.net/wiki/SC2039 -- In POSIX sh, string indexing is u...

Is this all that's necessary, or is there more that it missed?

@ajeetdsouza
Copy link
Owner

Support for PWD hooks in POSIX shells has been added in 7532fe9.

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

Successfully merging a pull request may close this issue.

3 participants