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:

  1. Open iTerm (make sure iTerm is in your applications folder or modify the code to point to the correct path)
  2. Enter nano .bash_profile
  3. 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
    }
    
  4. Control + X to exit nano
  5. Y and Enter to save
  6. Launch iTerm and type toggleiTerm
  7. Type 1 and Enter
  8. Relaunch application.

Profit.