2

When I have "Terminal" in the foreground and open another application, the new application opens in the background (rather than the foreground). This is rather annoying, as I always need to Cmd+Tab to the application after opening it.

This is not limited to the "open" command in Terminal - it also is occurring when I click the icon in the dock to open the application, or open the application using Spotlight (Cmd+Space).

Why is this happening, and how do I change it so that applications open in the foreground and context switches from Terminal to the newly opened application?

Note: this is a relatively new Mac, and a colleague who has also received a new Mac is also 'suffering' the same problem.

9
  • Does this issue happen with just Terminal? I.e. Could you be in another app, say Music.app and then opening another app from the dock say Notes.app... and then Music.app stays in the foreground with Notes.app opening in the background? If it's just affecting Terminal.app then I think there's some sort of preference plist setting that's keeping Terminal.app active in the foreground... but I don't know where to look for that setting unfortunately
    – AVelj
    Jan 27, 2022 at 2:21
  • Also when opening applications from terminal, you aren't using the -g or -j option when running the open command in terminal right? I.e. Don't run open -a [application name.app] -g command, but instead run open -a [application name.app]. I don't think this is your issue though, since you say it also happens with other opening methods, so I still think it has something to do with a plist file related to UI/Mission Control/Terminal/Global preferences, but I couldn't say which one.
    – AVelj
    Jan 27, 2022 at 2:34
  • 1
    @AVelj - yes, it only happens when Terminal is in focus. Just had another colleague discover that the issue occurs for them too. Possibly an OSX12 issue, maybe? It's not to do with opening things from the terminal, merely opening something when the terminal is in focus. The 'plist' sounds like a good line of investigation - however I can't fathom what value(s) I might play with. Feb 2, 2022 at 6:35
  • @techchiken, i'm not sure which plist either... There's an app called Prefs Editor by Thomas Tempelmann, that may help. The app essentially does what the defaults writes/read commands do, but presented as a GUI app. So you could load any plist in the app and investigate from there? Not sure if it will allow you to modify system plists requiring sudo but certainly any plists in your user directory, i.e. terminal's settings specific to your user.
    – AVelj
    Feb 3, 2022 at 2:06
  • 1
    It is very strange! I have posted on the Mac forums, but two other colleagues are experiencing the same thing with their [also brand new] Macs. I suspect it's a thing with macOS 12. I found a solution though - I've switched to iTerm ... no more issues. Not exactly a solution to this specific question, but a solution to my problem. Feb 9, 2022 at 2:26

1 Answer 1

2

The com.apple.terminal.plist is located in ~/library/preferences and deleting it resolved the issue in my case, where I was able to switch to the finder app but keystrokes were still being applied to terminal.

However, please note removing the plist also removed my custom terminal profiles so please go to Terminal>Preferences>Profile and click export on the gear cog if you wish to save your customizations. The problem with Terminal retaining functional focus may return if the profile is reimported, but I didn't get a chance to test this.

If removing the whole plist is not an option, try

defaults write com.apple.Terminal FocusFollowsMouse No

and restart Terminal.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .