-
Notifications
You must be signed in to change notification settings - Fork 17
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
Run alias from bash_profile in OS X #40
Comments
Hi @Irthen I've never tried this before, but now that I did I am also not able to get aliases to work. I'm not 100% sure why it isn't working. My hunch is that bash_profile is only loaded when one uses a terminal. process-palette uses shelljs for running commands, which in turn calls Node.js's child process. It might be that bash_profile isn't loaded then. I searched around a bit, but wasn't able to find out what exactly is happening or how to solve it. I'll look around some more, but thus far I haven't had any success. |
Hi @morassman! Thanks for your research. Another idea by me, I don't have time to test it right now: Is it possible to do anything like "source <path/to/.bash_profile>" and after that call an alias? Maybe this will solve the problem. |
That's actually one of the things that I tried, but it unfortunately didn't
work
…On 23 May 2017 9:10 PM, "Florian Liebe" ***@***.***> wrote:
Hi @morassman <https://github.com/morassman>!
Thanks for your research.
Another idea by me, I don't have time to test it right now: Is it possible
to do anything like "source <path/to/.bash_profile>" and after that call an
alias?
Maybe this will solve the problem.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#40 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ANEAauwA2WyTB8D3yc4-I-8Rgv0mnCbcks5r8y8WgaJpZM4Niwpw>
.
|
Ah, ok - nice to know, thx. Then I will skip this. :) Please feel free to do some research if you would like to do it - maybe you can handle it in some way. Thx! |
It's all documented: So, Even Or you could use |
but... |
I read the bash documentation regarding this myself, but still wasn't able to figure out how to use aliases from commands that are run from process-palette. Whether aliases are actually needed or not, the question still stands whether it's possible to use them from commands run from process-palette. I don't consider redefining the aliases as part of a script that is executed as a solution. Ideally one wants to define them in any of the files you listed and be able to use them without needing to redefine them. The question is more how one can get those files to be taken into account when running commands from process-palette. |
I use zsh, which has several files for different situations e.g. .zshenv, .zshrc, .zlogin, .zlogout and you have different possibilities to configure this (simple or fine grained and compatible modes). |
.bashenv should be executed in all shel if BASH_ENV is set to ~/.bashenv I read that some systems have this in /etc/environment Alternatively, you could set it yourself in a login shell (some *profile file). |
Ok, I'm not a bash expert (using zsh for min. 10 years) and I often wonder about bash problems. So, I tested it...
From a zsh shell window I get this:
Now,
now I get:
"Interesting", this doesn't work:
but this:
EDIT: no, it's the alias from the .bash_profile, not the one defined on the command line, so this doesn't work either! zsh can do this, but it's also puzzling:
seems like the alias is only defined after the rest of the line is executed. |
Turning my aliases to functions is not a real problem for me, but how can I use functions which are defined in my .bash_profile from process-palette? I do think that's the same problem with the aliases, isn't it? |
there ate two problems:
Now it depends on what you want. For which purposes do you use these aliases? With aliases are designed for interactive use. They are kind of shortcuts in bash, e.g. you cannot use parameters. |
Hi,
nice work! I really like this atom package. At the moment I am trying to include this in my tool chain.
Is it possible to create a process-palette command that will run an alias from my bash_profile? I am not able to get this running right now.
Thanks for your help!
Cheers
Florian
The text was updated successfully, but these errors were encountered: