Why does Terminal automatically launch a command?

dwalling

Registered
I found the following note posted back in Oct. '05. Following the thread (now in archives), there was no suitable solution. Being an absolute Mac newbie, I quickly encountered the same problem that Emilio reported moons ago. Here is is his original post. Following that, what I did to work around this. Any insight into the root cause and the best solution?

"Hello,

I'm in big trouble... My terminal application keeps on automatically starting a process and doesn't let me do anything! I can't enter any other command... Terminal has been doing this for a couple of weeks now. I have an Ibook G4... I am using MAX OS X

Thanks...

Emilio"


This same exact thing happened to me just yesterday. The day before I had used XCode to compile an old C program of mine. I cannot remember the last command I entered before logging out. But, the next time I started the system, logged in and ran Terminal, it automatically launched the program I had compiled, followed by "exit", which, of course, closed the Terminal session. After repeating this several times ... I don't know why ... perhaps to see if randomness truly exists in the Universe ... the same result kept happening. Not knowing, but suspecting that I had screwed up some kind of configuration for Terminal, I looked through the Terminal preferences for any kind of setting in the UI that might show some kind of auto-run value. Nothing there. So, I logged out of my user account and logged in as System Administrator (which, fortunately, I had enabled a few minutes before). As root, I perused by user account's home directory for anything that might give me a clue as to Terminal's behavior. Remember, I'm a newbie. .... so, I decided to punt. I created a new account name and copied over what files I needed into the new account. Now Terminal starts as expected under the new account, so whatever I did only affects the first user account I had setup. Would really like to know what's up here.

Thanks!
David
 
Suggestion:

01. Select the 'Terminal, Preferences...' menu item.
02. Verify that 'When creating a new Terminal window:'s 'Executer the default login shell using /usr/bin/login' radio button is selected.

If the 'Execute this command (specify complete path):' radio button is selected, with or without a user added command - each new 'Terminal' window will have the respectively entered command executed upon its opening.

03. Click on Steve Job's red Crayola crayon 'close' button to close the window, and (as on the copied from Windoze platform) save any setting changes.
 
I'm having this exact same problem. I run a chat program called BitchX and everytime I open Terminal, it is launching automatically.

Example:

Last login: Thu Nov 16 23:19:04 on console
/Applications/BitchX/BitchX; exit
Welcome to Darwin!
powerbook-g4-15:~ username$ /Applications/BitchX/BitchX; exit

I'd like to go back to regular /bin/bash where I can type in a command!

If anyone knows how to fix this, I'd greatly appreciate it.
 
Try searching your shell configuration files for the name of the offending command. tcsh users, look for ~/.cshrc, ~/.tcshrc, ~/.login. bash users look in ~/.profile, ~/.bashrc, ~/.bash_profile.

A nice little AppleScript (here) lets you modify the finder settings to show all those hidden files so you can open them with TextEdit (for example).

HTH
 
A) That Applescript is great, thanks!

B) I couldn't located any of those files. I tried to make blank ones to see if it would override any offending settings, but I think it's now a Terminal issue and not related to any particular shell.

When I double click bash, I get:

Last login: Fri Nov 17 08:08:17 on ttyp2
/bin/bash; exit
Welcome to Darwin!
powerbook-g4-15:~ username$ /bin/bash; exit
powerbook-g4-15:~ username$

But at least now I can type commands in shell from this user.

Also, none of my other users on this system are affected by the problem. Somewhere in the last few days, Terminal just decided it would be cool to do the following:

- add "exit" to the end of every command
- when Terminal is launched, automatically launch the BitchX irc chat client.

An easy fix would be deleting this user and starting over, but I'd have to move everything, setup all my settings again, etc. I'd also really like to know where these Windows Settings and Terminal Preferences are being saved to.

Anyone know?

zX
 
Do you have a .plist file in your ~/Library/Preferences/ folder? Something called com.apple.Terminal.plist or something along those lines (sorry I can't be more specific, I'm not near my trusty powerbook ATM). Maybe it's got an "ExecutionString" defined in it? Try removing that setting (or just rename the preferences file to something else) and see what happens. Terminal.app shouldn't be running when you make changes to, or rename, that file.
 
try looking in:
/Users/yourusername/Library/Application\ Support/Terminal

move anything you find there to a new folder on the desktop, then launch Terminal.

If there is nothing in the folder above, then look for:
/Users/yourusername/Library/Preferences/com.apple.Terminal.plist

Delete the file.

Quit from the Application (don't just close the window) after each unsuccessful attempt. Some applications (don't know about terminal...) read prefs into memory on launch. When the application is quit, they write their preferences files from memory back to the drive.
I may have been hallucinating, but I swear I've seen this happen. So quit the application in between each unsuccessful troubleshooting step.
 
You guys are awesome! That took care of the problem.

~/Library/Preferences/com.apple.Terminal.plist

ExecutionString had the command that was running every time.

I deleted it and it works like a charm.

Thanks a ton!
 
Back
Top