my iterm2 hotkey window has stopped working unless iterm2 is the foreground app
Assistant
If your iTerm2 hotkey window only appears when iTerm2 is the foreground app and doesn't show otherwise, it usually means the hotkey window feature isn't triggering correctly in the background. Here are some steps to troubleshoot and fix this issue:
1. Check Hotkey Window Settings
Open iTerm2.
Go to iTerm2 > Preferences > Keys tab.
Look under Hotkey section.
Make sure the checkbox for Show/hide iTerm2 with a system-wide hotkey is enabled.
Confirm the hotkey is set correctly (e.g., ⌘ + `).
2. Ensure Hotkey Window Profile is Set
Go to Preferences > Keys > Hotkey Window.
Confirm the "Hotkey Window" profile is selected.
This profile behaves differently from normal windows (e.g., it sticks on top, floats, etc.).
3. Confirm Accessibility Permissions
macOS needs explicit permission for apps to control UI elements and receive global keypresses.
Open System Preferences > Security & Privacy > Privacy > Accessibility.
Make sure iTerm2 is listed and checked.
If it’s not listed, add it by clicking the "+" button and selecting iTerm2.
Sometimes removing and re-adding helps.
4. Disable Conflicting Shortcut
Make sure no other app or macOS global shortcuts conflict with this hotkey.
Check System Preferences > Keyboard > Shortcuts to see if your iTerm2 hotkey is assigned elsewhere.
5. Restart iTerm2 and macOS
Sometimes a simple restart of iTerm2 or the entire system fixes transient issues.
6. Update iTerm2
Update to the latest version of iTerm2 as the issue might be fixed in a newer release.
7. Reset iTerm2 Preferences to Default
If the above fails, you can try resetting preferences:
Quit iTerm2.
In Terminal, run: mv ~/Library/Preferences/com.googlecode.iterm2.plist ~/Desktop/
Relaunch iTerm2 and reconfigure the hotkey window.
If after all this your hotkey window still requires iTerm2 to be the foreground app to work, please let me know your macOS version and iTerm2 version so I can provide more targeted help!