Question

I was using TotalTerminal to get visor like terminal on a shortcut. But TotalTerminal is abandoned so I have switched to the iTerm2. My problem is that when I use a shortcut to trigger iTerms visor behavior and profile it also gets activated like a normal app and gets into Cmd+Tab list of apps and I do not want that. Is there a way to prevent such behavior for visor profile of iTerm2?

Was it helpful?

Solution

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.

OTHER TIPS

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.

Open iTerm2 Preferences, go to Appearance tab and under System item check Exclude from Dock and ⌘-Tab Application Switcher.

method

There are a few applications that can "switch hit" in that they run either as a windowed/traditional app where it shows in the application switcher screen and as a background app or menu bar app.

For examples of this, look at Dash, Take Five and Skitch. Each has a preference to run in the "foreground" or the "background" and when you make a change to that preference, you have to quit and re-launch the app for the system to know how to handle the dock, windows and menu bar as well as the application switcher.

enter image description here

I see no sign that iTerm 2 has this functionality, so at best you will need to modify the application or recompile it if it's ready to go and just lacks the preference toggle in the application. My suspicion is the application will need more programming added to handle both cases and you'll need to live with that app in the switcher or choose a different terminal emulation tool.

Basically, the OS can accommodate an app designed to opt out of the dock and the app switcher, but it's not as simple as setting one preference on any app you want to change.

Licensed under: CC-BY-SA with attribution
Not affiliated with apple.stackexchange
scroll top