Geeky

The road to DevOps.

Slow shell open in OSX Lion

Do you find that opening a new tab in Terminal, or iTerm takes a long time? Maybe 5 to 10 seconds, instead of being nearly instant?

If so, you may want to take a look at Apple’s syslog replacement called ASL.

ASL stores its logs on OSX Lion, under /var/log/asl/.
When Terminal or iTerm open, by default the execute:

login -fp <username>

This (for whatever reason) seems to read all of the log files under that directory. If like me you have 300Mb of rotated log files in there since your last reboot, opening a new shell can take quite a while.

I don’t know what the impact of deleting the files is, but given that they’re log files I deleted the rotated ones anyway. So far, so good! Shells open quickly again!

Comments

5 responses to “Slow shell open in OSX Lion”

  1. nosli Avatar
    nosli

    Thanks a lot, this was killing me. I had some AppleScrips for starting iTerm and open some tabs with webserver/db/test etc. and they failed just because iTerm was so slow starting a new session. Works like a charm again, so thank you!

    1. Av Avatar

      You’re welcome!

  2. David Avatar
    David

    Perhaps a more permanent way is this (obtained from http://superuser.com/questions/31403/how-can-i-speed-up-terminal-app-or-iterm-on-mac-osx)

    For Terminal: Preferences → Startup: Change from “Default login shell” to “Command: /bin/bash -l”

    For iTerm2: Preperences → General → Command: Change from “Login Shell” to “Command: /bin/bash -l”

    1. Mateja Avatar
      Mateja

      Thanks, works like a charm!

  3. JeffH Avatar
    JeffH

    It’s a while later – but the behavior continues.
    In order to find the place to put the change in iTerm2 look in:
    Preferences -> Profiles -> Command : Change from “Login Shell” to “Command: /bin/bash -l”

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.