See this StackOverflow question . It looks like when updating TotalTerminal, the SCRIPT_NAME environment variable remains set for all new terminal windows until the computer is restarted. This breaks some webservers (gunicorn broke for me, rails for a guy on the SO question).
Restarting the computer fixes the problem.
darwin
November 12, 2013, 5:39pm
2
Do you have multiple users logged in on your machine? Is your webserver running under other users?
This is what TotalTerminal installer does to restart it (effective in future version):
#!/bin/sh
# replace /Applications/TotalTerminal.app with pre-Yosemite version, if needed
TMP=`sw_vers -productVersion|grep '10\.\(8\|9\)'`
if [ $? -eq 0 ]; then
rm -rf /Applications/TotalTerminal.app
cp -a /Library/ScriptingAdditions/TotalTerminal.osax/Contents/Resources/Agent/10.9/TotalTerminal.app /Applications
fi
sleep 2
TMP=`sw_vers -productVersion|grep '10\.\(8\|9\|10\)'`
if [ $? -eq 0 ]; then
# the goal here is to relaunch Terminal.app under the right user aka "Mach bootstrap namespace"
# note: we can have multiple users logged in concruently (for fast user switching), each has its own loginwindow process
# in $OUTPUT we will list all loginwindow processes and pick only the one belonging to the currently logged-in user
USERID=`id -u "$USER"`
OUTPUT=`ps -lax | grep '[l]oginwindow.app' | grep "^[ ]*$USERID "`
if [ -n "$OUTPUT" ]; then
set - $OUTPUT
This file has been truncated. show original
This is the code in the latest release (including 1.4.6):
I think the problem is that Terminal.app gets relaunched under different user account.
Nope, just one user.
SCRIPT_NAME
was set to postinstall
which makes me think it was some sort of leftover from the install process.
Perhaps something about launching TotalTerminal via launchctl after updating causes environment variables present in the install process to persist?
Just ran the update to 1.4.10 and got this taint again. Is it possible to simply run unset SCRIPT_NAME
at the end of the installer script to prevent this?
Same here, got it again. It had been just enough time for me to forget what was wrong… Lost another 15 mins or so debugging
darwin
February 13, 2014, 1:55am
6
I’m sorry for that. I just did some tests and implemented this change, which resolves the leaking environment on my 10.9.2 machine.
committed 01:20AM - 13 Feb 14 UTC
http://discuss.binaryage.com/t/totalterminal-update-overrides-script-name-breaks-webservers/897/4
This change will be effective since next release (1.4.11).
1 Like
darwin
February 13, 2014, 2:14am
7
Please download and install v1.4.11 . Please report back if you spot some strange environments in Terminal.app after installation.
1 Like
I just installed 1.4.11 and compared the output of /usr/bin/env
before and after the install. I didn’t see anything unexpected! Looks like you fixed it! Thanks @darwin !
1 Like