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

zoxide doesn't work on ksh #882

Open
neelchakrabrty opened this issue Sep 11, 2024 · 9 comments
Open

zoxide doesn't work on ksh #882

neelchakrabrty opened this issue Sep 11, 2024 · 9 comments

Comments

@neelchakrabrty
Copy link

Hello. I am writing a zoxide port for OpenBSD.
The port installs as expected, and zoxide works as expected on supported shells.
However, it doesn't work on ksh, which is what is currently blocking the port to be committed by the developers(I am not a developer).
I have tried adding eval "$(zoxide init posix --hook prompt)" to my .kshrc but it didn't work.
I have tried generating shell config using zoxide init but that threw an error too.
error: invalid value ksh for <SHELL>
Are there any known workarounds for this issue?
If not, is it possible to add support for ksh?

@ajeetdsouza
Copy link
Owner

I have tried adding eval "$(zoxide init posix --hook prompt)" to my .kshrc but it didn't work.

ksh is a POSIX-compliant shell, so this should work. Could you describe the exact issue?

@neelchakrabrty
Copy link
Author

It was an issue on my end. I forgot to source my .kshrc

@ajeetdsouza
Copy link
Owner

zoxide v0.9.5 now officially supports ksh. Do try it out whenever you get the chance!

@neelchakrabrty
Copy link
Author

I just tried it on OpenBSD-current.

I am getting the following error when I source .kshrc

ksh: trap: -p: unknown option
ksh: trap: bad signal DEBUG

@ajeetdsouza
Copy link
Owner

Which ksh are you using?

@neelchakrabrty
Copy link
Author

The one that is in OpenBSD base install.
https://man.openbsd.org/ksh.1

KSH v5.2.14

@ajeetdsouza
Copy link
Owner

Found the issue. It seems OpenBSD's ksh is lacking in some features:

The original Korn shell's DEBUG trap and the handling of ERR and EXIT traps in functions are not yet implemented.

@neelchakrabrty
Copy link
Author

For the time being, the POSIX shell method works.
That's good enough for me.

Thank you for helping me and adding support for KSH so quickly.

@ajeetdsouza
Copy link
Owner

For now I'd suggest using --hook prompt when initializing zoxide, I'll look into it once I'm able.

@ajeetdsouza ajeetdsouza reopened this Sep 13, 2024
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

2 participants