Re: [code] [textadept] Environment vars on OS X

From: Mitchell <m.att.foicica.com>
Date: Mon, 25 Jan 2016 22:27:21 -0500 (EST)

Hi Robert,

On Sun, 24 Jan 2016, Robert Gieseke wrote:

> Hi,
>
> as discussed recently[1] I did look a bit into whether it's possible to
> simplify getting the environment variables right on OS X. The problem is
> that when launched from the Finder, Dock, Spotlight etc. Textadept does
> not inherit/use environment variables one normally has set in a terminal
> session. When launched from there (with a `ta` script) everything is
> fine. Currently Textadept on OS X runs a script `osx_env.sh` in which
> environment variables like `PATH` can be set.
>
> Since `spawn` has an `env` parameter it might be possible to set this
> from within Textadept.
>
> I looked a bit what other apps on OS X are currently doing, there exist
> a few solutions[2][3] but there are differences between OS versions and
> it's not trivial to get the right environment if one uses a non-standard
> shell like `zsh` or `fish` (as I do). So if the `PATH` is not set for
> `bash`, only in `fish` these approaches might fail as well.
>
> I couldn't find a way to get something working in this manner.
>
> It might be an option to have a `OSX_ENV` table set in `init.lua` which
> would be set for `spawn` calls.
> With the current way `spawn`[4] is defined as overwriting the
> environment completely it might be confusing to have a special way on OS X.
>
> A reliable way to detect whether Textadept has been started not from a
> terminal appears to compare the path to the default
> "/usr/bin:/bin:/usr/sbin:/sbin".
>
> Any thoughts, experiences, ideas on this?
> We might of course keep things as they are as the script approach works
> (again) ...

Thanks for all the time you've spent looking into this! I am leaning
towards keeping things as-is. It sounds like trying to maintain something
across different versions of OSX would be more trouble than it's worth.

However, I don't use OSX hardly at all, so if you or other OSX users come
up with something better than the existing functionality, I would
certainly be open to including it by default.

Cheers,
Mitchell

-- 
You are subscribed to code.att.foicica.com.
To change subscription settings, send an e-mail to code+help.att.foicica.com.
To unsubscribe, send an e-mail to code+unsubscribe.att.foicica.com.
Received on Mon 25 Jan 2016 - 22:27:21 EST

This archive was generated by hypermail 2.2.0 : Tue 26 Jan 2016 - 06:30:17 EST