Skip to content

Instantly share code, notes, and snippets.

@stvhwrd
Last active August 15, 2024 23:48
Show Gist options
  • Save stvhwrd/ef4e177ab2c688b3b2c3 to your computer and use it in GitHub Desktop.
Save stvhwrd/ef4e177ab2c688b3b2c3 to your computer and use it in GitHub Desktop.
Hide the iTerm dock icon on Mac OS X

Note: you can now configure this simply in iTerm2's application settings. Go to Preferences > Appearance > System and select "Exclude from Dock and ⌘-Tab Application Switcher".


On my dual-drive MacBook Pro I have remapped the eject key to F13 using Karabiner and NoEjectDelay. The eject key has been assigned as the hotkey for a guake-style visor terminal using iTerm2. Having its own hotkey precludes the need for an icon, so I prefer to hide the iTerm dock icon.

To hide the dock icon of iTerm2 on Mac OS X:

/usr/libexec/PlistBuddy -c 'Add :LSUIElement bool true' /Applications/iTerm.app/Contents/Info.plist

To undo the above:

/usr/libexec/PlistBuddy -c 'Delete :LSUIElement' /Applications/iTerm.app/Contents/Info.plist

Disable animation of hotkey window on iTerm2:

defaults write com.googlecode.iterm2 HotkeyTermAnimationDuration -float 0.00001


tested with iTerm 2.0.0.20150412 on Apple MacBook Pro (Late 2011) running OS X 10.10.3

credit

@ilnurnasyrov2
Copy link

@m4w
Copy link

m4w commented Feb 14, 2017

It seems, that this does not work anymore (at least on MacOS Sierra or with iTerm 3.0.x). If I use that command, the dock icon will be hid but after closing iTerm2 it will not open again.

@ilnurnasyrov2
Copy link

ilnurnasyrov2 commented Mar 2, 2017

It works for me, iterm doesn't open if it is "closed unexpectedly".

@alipov
Copy link

alipov commented Oct 4, 2017

As of v3.1.2, you can configure this behavior from iTerm2's Preferences: go to Appearance tab, under System -> Exclude from Dock and ⌘-Tab Application Switcher.

@bismailov
Copy link

As of v3.1.2, you can configure this behavior from iTerm2's Preferences: go to Appearance tab, under System -> Exclude from Dock and ⌘-Tab Application Switcher.

Yep, this worked great!

@treefitty
Copy link

A note for future readers, this is actually supported natively in the app now: https://apple.stackexchange.com/questions/415556/how-to-hide-the-iterm-icon-from-status-menu

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment