How can I figure out what's opening a Terminal window whenever I log in? Whenever I log in to my Macbook, a terminal window pops up with what appears to be some Java CLI help text and a [Process completed] (or whatever) at the bottom. It doesn't cause any problems that I can see; I always just close the window and move on. I vaguely remember installing the thing a long time ago that caused this to start happening; but I don't remember what it was or how to find it.

I've Googled "Mac startup scripts" and checked various directories for any obvious culprits, but nothing jumps out. Is there any good way for me to definitively determine what startup item is causing this window to open, so that I can get rid of it? For example does the Terminal app provide any visibility into what command started it up (is that what's printed at the top)? And if so can I easily deduce from that where the startup script/daemon/agent/whatever is?

Basically, what would you do if you were me? Admittedly this is really just an aesthetic annoyance, nothing more. Maybe the sane answer is "I'd leave it alone rather than risk screwing something up." Just seems irritating that I can't even figure out how to stop a window from popping up whenever I reboot my computer.
This might not be too helpful, but you can always check the date you downloaded things in your Applications folder and (if you remember the date, even vaguely) if you delete it, or anything non-essential near that date, then go by the process of re-installing what you want to find out what is causing the problem (or just leave them uninstalled). 

This is my recommendation, and if you are still seeing problems I would recommend Apple Tech Support (the official one).