TotalTerminal update overrides SCRIPT_NAME, breaks webservers

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.

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):

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

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.

This change will be effective since next release (1.4.11).

1 Like

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