11 Mar '06 - + 24 - 30 Weird Terminal Bug

Weird. This is one of those mildly annoying problems that have to bug me several times before I focus the energy to track them down. Recently, every time I open a new Terminal window, Terminal has been changing the working directory to a folder deep in my Documents tree. I thought this was very strange and couldn’t find evidence in my login scripts that this should have happened.

It turns out the problem is that when you use AppleScript to execute commands via Terminal, the last command you perform via the “do script” AppleScript command can get “stuck” in Terminal’s ExecutionString preference, which is run whenever a Terminal window opens. (Fortunately for me, the command that got stuck was a simple cd command.) There is no interface in Terminal to view or edit ExecutionString, which makes the bug a bit tricky to track down. (Huzzah for Google, as usual.) To fix it, you need to either edit com.apple.Terminal.plist manually, or execute the following command in a Terminal window:

defaults write com.apple.terminal ExecutionString

No comments yet:

Remember personal info?

Comment: /
Comment spam is an unfortunate problem on our site. Making you answer an Obvious Question is one way to defeat the spambots.
Obvious Question: How many states are in the United States (50)?

Small print: All html tags except <b> and <i> will be removed from your comment. You can make links by just typing the url or mail-address.