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

Add support for kornshell #769

Closed
k2662 opened this issue Mar 21, 2024 · 9 comments
Closed

Add support for kornshell #769

k2662 opened this issue Mar 21, 2024 · 9 comments

Comments

@k2662
Copy link

k2662 commented Mar 21, 2024

I use this in zsh, but would like it in kornshell as the

eval "$(zoxide init posix --hook prompt)"

is a little janky

@ajeetdsouza
Copy link
Owner

What's janky about it?

@ajeetdsouza ajeetdsouza added the waiting-for-response Waiting for a response from the issue author. label Mar 22, 2024
@k2662
Copy link
Author

k2662 commented Mar 22, 2024

It doesn't always work and kornshell has more features than a generic posix shell. We could use these features to improve performance of zoxide in kornshell. Here is the kornshell I use : https://github.com/ksh93/ksh

@github-actions github-actions bot removed the waiting-for-response Waiting for a response from the issue author. label Mar 22, 2024
@k2662 k2662 changed the title add support for kornshell Add support for kornshell Mar 22, 2024
@ajeetdsouza
Copy link
Owner

It doesn't always work

Could you elaborate? If there's a bug in the generic POSIX implementation, we should fix that.

kornshell has more features than a generic posix shell. We could use these features to improve performance of zoxide in kornshell.

What Korn-specific features do you think zoxide should be utilising? Is there any part of zoxide that's running slow on your system?

@k2662
Copy link
Author

k2662 commented Mar 25, 2024

It doesn't always work

Could you elaborate? If there's a bug in the generic POSIX implementation, we should fix that.

kornshell has more features than a generic posix shell. We could use these features to improve performance of zoxide in kornshell.

What Korn-specific features do you think zoxide should be utilising? Is there any part of zoxide that's running slow on your system?

The execution time in kornshell is slow. My systtem has 4 cores and 8 threads. (2017 macbook pro 15 inch)

@ajeetdsouza
Copy link
Owner

There's not much to do here, unfortunately:

  • zoxide does most of its work in Rust - the shell plugin for POSIX is around 37 lines of code
  • There are no features specific to Korn that would cause a speedup for zoxide (at least, not that I'm aware of)

zoxide is a very light binary, a 2017 MacBook is more than sufficient for it. There may be a one-off slowdown because macOS checks binaries before executing them the first time, but that should not persist. What exactly takes long to execute on your system?

@ajeetdsouza ajeetdsouza added the waiting-for-response Waiting for a response from the issue author. label Mar 26, 2024
@kaesluder
Copy link

(Did some work in ksh a while back.)

Briefly tested on OpenSUSE tumbleweed. Unable to replicate the problem. I looked through the man page and didn't find any additional hooks other than $PS1 that could be used for this, but I could be wrong.

~ ksh --version
  version         sh (AT&T Research) 93u+ 2012-08-01

➜  ~ uname -a
Linux localhost.localdomain 6.8.1-1-default #1 SMP PREEMPT_DYNAMIC Tue Mar 19 07:32:20 UTC 2024 (d922afa) x86_64 x86_64 x86_64 GNU/Linux

CPU Info model name : Intel(R) Core(TM) i5-10210U CPU @ 1.60GHz

~/.kshrc

echo "Hello world"
eval "$(zoxide init posix --hook prompt)"

@ajeetdsouza
Copy link
Owner

Agreed, I don't think this issue is actionable.

@ajeetdsouza ajeetdsouza removed the waiting-for-response Waiting for a response from the issue author. label Apr 3, 2024
@ajeetdsouza
Copy link
Owner

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

@k2662
Copy link
Author

k2662 commented Sep 13, 2024

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

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

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

Thank You!
And sorry for not responding was busy w/ school.

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

3 participants