

It seems this can be worked around by adding an & after the program name, and then using some Apple Script to close the window. The problem with this approach, is a Terminal window is displayed and closing this window kills the child process. To have it executed, it seems it needs to be named. sh, then when double clicking in finder, it always opens the file in an editor, rather than executing it, so that doesn't work. You would have a shell script "start_app.sh" or something and it would define all the environment variables you would need and launch the GUI via X." Or at least, that was how we used to do it back in Solaris days. "If they are X11 apps, then you would set the environment variables with a wrapper, the same way you would do it on Linux. This seems to be a problem for a whole host of IDEs on OSX: And you want the path to be set for the GUI apps, as well as when you open a terminal, or ssh in to use them. In order to point the IDE at the correct command line tools, you would set the PATH variable. These are packaged separately, as they come from different vendors. There are lots of IDEs out there, that can drive a variety of command line tools.

This doesn't appear to be the case for a Mac.
#Eclipse ssh shell enter twice windows
When you ssh in to a windows or linux box, you're able to get the same environment as you would on a local terminal. With regards to ssh, I'm talking about ssh'ing in to the Mac. Again, you can write a little shell script to export just what you need and open an ssh connection in a properly configured environment. I suggest you identify the variables you need using something like the ssh "SendEnv" option. There is no way an "export" like that would ever work. An external system is going to have completely different paths and variables. I don't know of any way, but then I wouldn't ever try anything like that. I'm sure there has got to be some way to do that. Just go through the environment and spit out the commands to export all those variables, then send those commands over an ssh connection. I'm sure you could hack something up in a shell script pretty easily.

I checked on 10.6 and launchctl did have a crude export functionality back then. (It might not work in a few of months though.) You can hack it with launchctl, which you seem to have done, and it may work. If these apps were partially ported to the Mac, or ported circa MacOS X 10.3 or something, then they are just wrong.
#Eclipse ssh shell enter twice software
You could have multiple versions of the software installed and just run "start_app.sh" and it would bootstrap according to where you launched it from.īut that is how it is supposed to work in Linux, Solaris, and X.

You would have a shell script "start_app.sh" or something and it would define all the environment variables you would need and launch the GUI via X. How were those apps ported? If they are X11 apps, then you would set the environment variables with a wrapper, the same way you would do it on Linux. Sudo launchctl config user path /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/me/mydir The "launchctl config" command seems to allow PATH to be set (after a reboot) for GUI apps, but it doesn't appear to work for the terminal. It has one other slight issue, in that it doesn't seem to work for applications that are reopened at login, if "Reopen windows when logging back in" is checked This seems to work ok for environment variables other than PATH, for GUI and local shells, but not ssh. E.g.Ĭreate file: /Library/LaunchAgents/istĪnd load with: launchctl load /Library/LaunchAgents/ist It seems possible to set some environment variables globally using launchctl and a plist. Editing /etc/paths and /etc/paths.d/ - this only seems to apply to command line apps. Setting the variables in ~/.bash_profile - this only seems to apply to command line apps. It should work with System Integrity Protection enabled It should work for both local shell and also remote SSH shells It should work for both GUI + command line applications. A method that works from Yosemite and later versions of the OS What is the recommended and most compatible way to set the PATH and other environment variables globally? I would like:
