Why does "Terminal" retain focus / stay in the foreground when I open other apps, and how do I prevent or change that?

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 running OS 12.2 and my colleagues are experiencing the same issue with their new Macs.

Posted on Feb 3, 2022 3:36 PM

Reply
Question marked as Top-ranking reply

Posted on Feb 8, 2022 10:50 PM

Not sure when this was added, but there's a new item under the Terminal menu called "Secure Keyboard Entry" which has this non-hand-off as a side-effect. Turn it off and Terminal behaves as it always used to. Hopefully they can figure out a way to allow for both things at once at some point.

Similar questions

7 replies
Question marked as Top-ranking reply

Feb 8, 2022 10:50 PM in response to unruly83

Not sure when this was added, but there's a new item under the Terminal menu called "Secure Keyboard Entry" which has this non-hand-off as a side-effect. Turn it off and Terminal behaves as it always used to. Hopefully they can figure out a way to allow for both things at once at some point.

Feb 9, 2022 7:55 AM in response to unruly83

Quit Terminal. In a Finder window, drag (move) the Terminal .plist (/Users/username/Library/Preferences/com.apple.Terminal.plist) to your Desktop. When you launch Terminal again, it will take its defaults and newly launched applications will appear over the Terminal application. This is what I did to solve the issue on macOS 12.2 on a 2021 16-in M1 Pro.


I am now reviewing that .plist in Xcode to determine what specifically caused the foreground annoyance.

Feb 9, 2022 6:29 AM in response to unruly83




unruly83 wrote:

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 running OS 12.2 and my colleagues are experiencing the same issue with their new Macs.



ref: https://support.apple.com/guide/terminal/use-secure-keyboard-entry-trml109/mac

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Why does "Terminal" retain focus / stay in the foreground when I open other apps, and how do I prevent or change that?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.