-
Notifications
You must be signed in to change notification settings - Fork 54
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
Fish shell support? #18
Comments
Sorry, I won't be adding fish support -- it would basically require everything to be to re-implemented from scratch. You can see details here #16 Again, sorry to disappoint you |
Would you implement fish support (e.g. a "fish" flag in |
Sure! I would suggest we start with one slice, Could you port it to fish and share the code here? I will give some thought to what would be the best way to store the fish code in the repository. |
Ok, thanks! This implementation is only with awk, but I'll give a try with sed to compare the performance (I'm sorry but fish doesn't support native string manipulation till now).
|
Thanks! Please don't do any performance optimizations for now. I'll try to come up with a decent way to keep the fish code in the repository. Will let you know when I have something working |
All right! |
After giving some thought to this, I think this might be a decent approach: instead of duplicating all the code in the repo and spawning tons of sed/awk/grep processes during runtime, just spawn one bash process to render the prompt. This might seem a bit ugly at first, but could do the job pretty well I think: fish doesn't have much advanced scripting functionalities (which is it's design decision) so it would need some external tool to render the prompt. bash could be this "external tool", with something like:
I did a quick prototype and it seems quite functional... although there is some issue with colors/quoting. Please let me know what you think of this approach. Do you see any pitfalls? |
Your approach looks nice! Nevertheless I ported the shell code to fish and made (IMHO) some improvements. But you're right when you saying:
So firstly I don't wan't to integrate all the duplicated code into the repo, because I'm not sure if it would make sense to maintain the code twice (if you want, you can do it 😉) and secondly the bad string manipulation made me unhappy so I took care of it and now there is something happen (last comment from @kballard) at the fish-shell project. For now it's a little bit slow, but with the coming improvements I think it'll be fast like your version. Here is the .promptline.fish and that's a little demo: PS: I tested the script on Ubuntu 14.04 and OS X (10.9). |
I just commented on the gist with a rewritten version of |
@kballard Thank you ever so much! I updated and commented the gist. @AnderRasoVazquez If you are still interested in a fish version take a look at this gist. |
Great, thanks for sharing the gist! However, I'll stick with the approach I described above (fish will execute a bash script to get its prompt) as this would keep the codebase simpler. Once fish has string manipulation capabilities, I might revisit this topic. Will let you know when fish support is added to promptline. BTW sorry for the late response, I was away for a couple of weeks :) |
Support for fish is now added! @mamiu thank you very much! |
This is great guys, I've followed the developing since beginning. Times like this makes open source great. Thank you =) |
Would be nice to have fish shell support.
Keep up the good work! =)
The text was updated successfully, but these errors were encountered: