-
Notifications
You must be signed in to change notification settings - Fork 101
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 support #18
Comments
Wanted to create an issue to track this feature as this would be an absolutely game changing feature for me personally. From the FISH issue it sounds like this is already being worked on, but if not I would be more than happy to give it a try. I am not rust expert by any means, but I have done some in the past for work. |
I'm working on it right now. There's three major components to zsh support.
I've investigated these and they seem possible to do with zsh. I'm currently working on detecting which shell is in use. |
Sounds good to me, as I said, let me know if there is anything I can do. Maybe to start have a configuration option for the type of shell. And then add in auto discovery right after? I am a pretty heavy zsh user, 2. should be fairly easy, no idea about 3 |
Hey I think ZSH support is in a good shape now. It works well on my Linux machine. Can you try it out and let me know if you have any issues? You can compile the |
Of course!
However, when I set Can debug the detection in a little bit, need to finish up some work on my end first. Might either be OSX details, or a peculiarity with my machine. Thanks so much for adding ZSH support so quickly though. This tool is really a game changer, and editing one line of yaml is not a big deal at all! |
I asked my buddy to test it on his Mac, and he also got this error. It seems like the I'm trying to setup a Mac virtual machine to test kubie on it. |
Ok so I ran ps on the Mac virtual machine... The zsh binary is called |
@EItanya can you try again? I searched on the net and this is because zsh is a login shell, so ps adds a dash before. I added a commit to trim it. |
Just tried again, that's working for me! My shell is now displaying 2 separate prompts, this may have to do with my particular setup, because I am running [starship]https://github.com/starship/starship.
Overall though working great, just those 2 small things |
Okay, just read through the code, based on my limited knowledge of the zsh impl of |
Yeah kubie adds the |
Yea that would be awesome! Not sure how common this will be, but I know for instance that most people in my office also have their own prompts, so 🤷♂ |
Kubie is meant to prepend its prompt to whatever prompt is configured, so it shouldn't break your prompt. I'm not sure why the interaction with starship is weird like this, it might just be because the kubie prompt and the starship prompt combine to something too long. |
I've reused the prompt for bash/zsh for simplicity's sake. This could definitely be improved in the future by having a more generic structure for constructing the prompt based on the output of the `kubie info` commands and a set of colors. This change was verified with my fish prompt based on starship.rs, and while it works, it's not prepending it on the same line. This is because of the starship prompt is outputting a clearing ANSI escape code. (It would be possible to check for the existence of that code and inject the prompt after it, effectively ending up where one would expect the prompt to be, though I'm not convinced that type of logic belongs in Kubie.) The outcome is exactly the same as in [this comment](sbstp#18 (comment)). The right-side prompt works as expected, though. I reused the zsh RPS1 setting for determining whether right-side prompt is enabled. It would feel redundant to have one right-prompt setting per shell, but OTOH the current name is hard-tied to zsh.
I've reused the prompt for bash/zsh for simplicity's sake. This could definitely be improved in the future by having a more generic structure for constructing the prompt based on the output of the `kubie info` commands and a set of colors. This change was verified with my fish prompt based on starship.rs, and while it works, it's not prepending it on the same line. This is because of the starship prompt is outputting a clearing ANSI escape code. (It would be possible to check for the existence of that code and inject the prompt after it, effectively ending up where one would expect the prompt to be, though I'm not convinced that type of logic belongs in Kubie.) The outcome is exactly the same as in [this comment](sbstp#18 (comment)). The right-side prompt works as expected, though. I reused the zsh RPS1 setting for determining whether right-side prompt is enabled. It would feel redundant to have one right-prompt setting per shell, but OTOH the current name is hard-tied to zsh.
I've reused the prompt for bash/zsh for simplicity's sake. This could definitely be improved in the future by having a more generic structure for constructing the prompt based on the output of the `kubie info` commands and a set of colors. This change was verified with my fish prompt based on starship.rs, and while it works, it's not prepending it on the same line. This is because of the starship prompt is outputting a clearing ANSI escape code. (It would be possible to check for the existence of that code and inject the prompt after it, effectively ending up where one would expect the prompt to be, though I'm not convinced that type of logic belongs in Kubie.) The outcome is exactly the same as in [this comment](sbstp#18 (comment)). The right-side prompt works as expected, though. I reused the zsh RPS1 setting for determining whether right-side prompt is enabled. It would feel redundant to have one right-prompt setting per shell, but OTOH the current name is hard-tied to zsh.
I've reused the prompt for bash/zsh for simplicity's sake. This could definitely be improved in the future by having a more generic structure for constructing the prompt based on the output of the `kubie info` commands and a set of colors. This change was verified with my fish prompt based on starship.rs, and while it works, it's not prepending it on the same line. This is because of the starship prompt is outputting a clearing ANSI escape code. (It would be possible to check for the existence of that code and inject the prompt after it, effectively ending up where one would expect the prompt to be, though I'm not convinced that type of logic belongs in Kubie.) The outcome is exactly the same as in [this comment](#18 (comment)). The right-side prompt works as expected, though. I reused the zsh RPS1 setting for determining whether right-side prompt is enabled. It would feel redundant to have one right-prompt setting per shell, but OTOH the current name is hard-tied to zsh.
Support spawning ZSH sub shells.
As mentioned in the recent blog post, zsh support is planned for the future.
The text was updated successfully, but these errors were encountered: