Home » Questions » Computers [ Ask a new question ]

How Can I Speed Up Terminal.app or iTerm on Mac OSX?

How Can I Speed Up Terminal.app or iTerm on Mac OSX?

Every time I launch either iTerm or Terminal after not using it for a few hours, it takes anywhere from 10-20 seconds to return a prompt. The screen is blank, and although I can type I can't actually run any commands.

Asked by: Guest | Views: 262
Total answers/comments: 5
bert [Entry]

"Try deleting the Apple system log files in /var/log/asl/:

sudo rm /var/log/asl/*.asl

This did the trick for me."
bert [Entry]

"Am I required a certain reputation to comment on posts? Anyway clearing the system logs did it for me as well, thanks. I have tried to patch path_helper with the patch here: gist.github.com/123525, as suggested in a comment on http://mjtsai.com/blog/2009/04/01/slow-opening-terminal-windows/ (referenced earlier in this thread) but to no avail. I get a cryptic error. However, that patch should speed up terminal.app launch.

addition: As I mentioned, clearing the logs did the trick for me, but the problem continues to emerge as the logs continously grow bigger after I've removed them. I found that ""tweaking"" /etc/asl.conf has given me a more permanent solution. The modification is to log only messages that are categorised as ""critical"" or more critical than that, as opposed to logging ""notice"" category and every more critical than that. Also, I disregard messages from ftp, mail, local0, local1. Here's a paste of my /etc/asl.conf:

##
# configuration file for syslogd and aslmanager
##

# redirect com.apple.message.domain to /var/log/DiagnosticMessages
? [T com.apple.message.domain] store_dir /var/log/DiagnosticMessages exclude_asldb

# authpriv messages are root/admin readable
? [= Facility authpriv] access 0 80

# remoteauth critical, alert, and emergency messages are root/admin readable
? [= Facility remoteauth] [<= Level critical] access 0 80

# broadcast emergency messages
? [= Level emergency] broadcast

# save kernel [PID 0] and launchd [PID 1] messages
? [<= PID 1] store

# save everything from emergency to notice
#? [<= Level notice] store
? [<= Level critical] store

# save lpr info level and above
#? [<= Level info] [= Facility lpr] store

# save all mail, ftp, local0, and local1 messages
#? [= Facility mail] store
#? [= Facility ftp] store
#? [= Facility local0] store
#? [= Facility local1] store"
bert [Entry]

"My guess is that over time, something is using a lot of memory. When you startup a terminal after not using it for a while, some memory has to be made available by swapping its contents out to disk. If you kill the terminal process and restart it relatively quickly the memory is still available and it starts up quickly. This should happen with other applications as well.

You should monitor your memory usage with Activity Monitor and see if you can tell where it is going."
bert [Entry]

"Open /etc/profile and add the line PATH="""" so it looks like this:

if [ -x /usr/libexec/path_helper ]; then
PATH=""""
eval `/usr/libexec/path_helper -s`
fi"
bert [Entry]

"If you are using oh my zsh with composer plugin, just remove it.(I'm running OSX 10.14 on a MacBookPro)

# .zshrc
plugins=(git) # composer will slow you down"