-
-
Notifications
You must be signed in to change notification settings - Fork 643
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
Always use indirection to locate interpreter #763
Comments
Hey @ryan-mooore thanks for opening this. xbar executes it like a normal program so I wonder if it's something to do with the |
Yep, this still occurs with For more info I am on an M1 MacBook Air running MacOS 12 beta 6. I am using the latest beta of xbar with M1 support. My default shell is |
Just worked out that this is because This is more a problem with lack of guidelines around xbar-plugins than anything else. All plugins should be using the |
Great feedback! We'll update the docs. |
I've added this PR: #766 - do you think that covers it? |
Perfect, now I guess the only issue is people trying to run already existing plugins like I tried to, I guess you don't want to go around changing other people's plugins? My first experience with xbar was downloading a few plugins and half of them being broken, which is not a great user experience. Any plugin that started with a |
One solution, and I'm not saying this is a good idea, is to rewrite the shebang line for the script on import... |
That's definitely a potential solution.. Here's the issue as I see it: the file loader needs to know what interpreter to use to run the script. This is essentially just a piece of metadata of the script. Convieniently there's an already widely established convention for that metadata with the shebang. However it has always had the core problem of bad portability, which is very important for this app. So the solutions I can see are:
|
When I first installed xbar, I downloaded a whole load of different plugins and realised almost none of them are working correctly, i.e. many bash script features such as command substitutions were not working.
I made a plugin named
001-test1.1s.bash
which is simply:Running this script in terminal with
$ bash 001-test1.1s.bash
gives an output of5.1.8(1)-release
, which is what I would expect the output to be when running with xbar. However xbar outputs3.2.57(1)-release
, a very old version of bash.After further research, I found that
/bin/sh
in macOS is just an old version of/bin/bash
running insh
compatibility mode, and if I run the script with sh in terminal i.e.$ sh 001-test1.1s.bash
this gives exactly the same output, so I am guessing that xbar is running the script with/bin/sh
, and not respecting the shebang at the top of the file or the .bash file extension.The text was updated successfully, but these errors were encountered: