[code] [textadept] Environment variables on OS X

From: Robert Gieseke <rob.g.att.web.de>
Date: Tue, 12 Nov 2013 13:52:46 +0100


when loading Textadept.app from the Dock or the Finder shell environment
variables are not loaded. To set these there used to be a way to set
these in a properties file[1]. Later OS X versions (10.8 I believe)
changed this [2].

Since Textadept already uses and sets environment variables in its
launcher script I thought why not use this for setting $PATH and would
like to propose the following addition to textadept_osx:

# Source '~/.textadept/environment.sh' to set variables like $PATH when
# opening Textadept.app from the Dock or the Finder.
if [ -f $HOME/.textadept/environment.sh ]
   then . $HOME/.textadept/environment.sh

In this script 'environment.sh' I can for example have
export PATH=$HOME/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/bin

I considered loading files like '.profile' or '.bash_profile' but this
seems more error-prone to me. (If people like they can of course source
their path settings from environment.sh.) Other OS X editors have
internal path settings but since we don't have an os.setenv this could
be a simple solution. There might be a better name than 'environment.sh'
of course …

- Robert

[1] https://developer.apple.com/legacy/library/qa/qa1067/_index.html

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 Tue 12 Nov 2013 - 07:52:46 EST

This archive was generated by hypermail 2.2.0 : Wed 13 Nov 2013 - 06:42:03 EST