Always Remember: With Gusto Comes Data Loss.

Speeding up Terminal Window/Tab Opening (10.9)

Alright – this one is going to be short and sweet. A problem that begins to crop up with Terminal over time is that when you open it, it can take a number of seconds to “load” to the actual command prompt. You can begin typing while it loads, and it should catch up with you without problem, but the delay bothers the hell out of me, and I would assume a lot of other people. Luckily, the cause of and resolution to this is very simple.

The Cause:
The reason for this delay is that when Terminal opens a new window or new tab its default behavior is to show the last login and the MOTD. The delay is the result of the program having to search through the Apple System Log to discover the last login time. Because these logs can become quite large and fragmented over time, it begins to take Terminal longer and longer to find this information, causing the delay.

The Fix:
The fix is very simple assuming you use the default shell. By default it will respect the existence of the .hushlogin file, which quiets the login and causes it to skip the login and MOTD search. All you need to do is create this file in your home directory. So open Terminal (which should open to your home folder by default) and type:

touch .hushlogin

That’s it! Quit and re-launch Terminal and you should notice there is no longer a long delay in getting to the prompt.

Warning:
A quick security warning – If you are in an environment where Terminal is required to show the MOTD (for compliance reasons), or where it is necessary or useful to know when Terminal was last logged in, you may not want to do this. While it does not remove any of this information, it also does not display it (as demonstrated below), which can become a problem for some. Sorry.

Example:

term1

A newly opened Terminal window, note the last login displayed at the top. If I had a MOTD, it would be displayed there as well.

term1

Enter the command to create the proper file.

term1

A newly opened Terminal window showing the lack of last login.

Leave a comment

Your email address will not be published. Required fields are marked *