Apple - Remove iterm from cmd+tab apps
Currently as of October 2016 iTerm2 has enabled this functionality.
Go to Preferences -> Advanced -> General -> Hide iTerm2 from the dock and from the ⌘-Tab app switcher
.
The "launch service key" LSUIElement
in the .plist
file for iTerm2 is your friend.
To hide iTerm2 from the switcher, open Terminal and enter:
/usr/libexec/PlistBuddy -c "Add :LSUIElement bool true" /Applications/iTerm.app/Contents/Info.plist
You will need to relaunch iTerm2 for the setting to have an effect.
If you wish to show iTerm again, use the following command:
/usr/libexec/PlistBuddy -c "Delete :LSUIElement" /Applications/iTerm.app/Contents/Info.plist
Explanation from Apple:
LSUIElement
“Application is agent (UIElement)”. Specifies whether the app is an agent app, that is, an app that should not appear in the Dock or Force Quit window. See LSUIElement for details.
There are some good modifications on GitHub. The easiest I found is here:
https://gist.github.com/CrazyApi/5377685
Ensure you have a Hot Key set to toggle iTerm. Once you disable the dock icon, there's no way to launch a window otherwise. To get the TotalTerminal visor style, you'll want to set your iTerm window preferences style drop-down to "Top of Screen"
Place the code from the GitHub post in your bash_profile:
- Open iTerm (make sure iTerm is in your applications folder or modify the code to point to the correct path)
- Enter
nano .bash_profile
Paste this code:
# toggle iTerm Dock icon # add this to your .bash_profile or .zshrc function toggleiTerm() { pb='/usr/libexec/PlistBuddy' iTerm='/Applications/iTerm.app/Contents/Info.plist' echo "Do you wish to hide iTerm in Dock?" select ync in "Hide" "Show" "Cancel"; do case $ync in 'Hide' ) $pb -c "Add :LSUIElement bool true" $iTerm echo "relaunch iTerm to take effectives" break ;; 'Show' ) $pb -c "Delete :LSUIElement" $iTerm echo "run killall 'iTerm' to exit, and then relaunch it" break ;; 'Cancel' ) break ;; esac done }
- Control + X to exit nano
- Y and Enter to save
- Launch iTerm and type
toggleiTerm
- Type
1
and Enter - Relaunch application.
Profit.