sublime_text
sublime_text copied to clipboard
ST window is not focused when calling subl --wait /path/to/file
Description of the bug
When I call subl --wait /path/to/file
from the terminal, the sublime text app doesn't get focused automatically. I have to manually switch to the space where it opens. I believe this behaviour has worked before so it probably is a regression.
Steps to reproduce
- Start ST in safe-mode from the command-line (
subl --safe-mode
). - Write some text in a buffer.
- Move ST window to space 1.
- In space 2, run subl --safe-mode --wait /path/to/file.
Expected behavior
I expect macOS to switch to space 1 and to focus on ST window automatically.
Actual behavior
macOS remained in space 2, focused on the Terminal app.
Sublime Text build number
4126
Operating system & version
macOS 12.5.1
(Linux) Desktop environment and/or window manager
No response
Additional information
- Using an Apple mac mini m1.
- Using 1 display.
- MacOS is configured to switch space when switching to an app that has windows in another space.

OpenGL context information
No response
Interestingly I have the same issue on Windows. I'm using Sublime Text as my Git editor via subl -w
and invoking a command such as git commit --amend
via PowerShell 7 on Windows Terminal. After editing the text and closing the tab, I'm returned to Windows Terminal but the window doesn't have focus. At that point, I must click on the Windows Terminal window to be able to type again.