sublime_text icon indicating copy to clipboard operation
sublime_text copied to clipboard

ST window is not focused when calling subl --wait /path/to/file

Open afpr252 opened this issue 2 years ago • 1 comments

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

  1. Start ST in safe-mode from the command-line (subl --safe-mode).
  2. Write some text in a buffer.
  3. Move ST window to space 1.
  4. 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

  1. Using an Apple mac mini m1.
  2. Using 1 display.
  3. MacOS is configured to switch space when switching to an app that has windows in another space.
Screenshot 2022-09-13 at 11 10 16

OpenGL context information

No response

afpr252 avatar Sep 13 '22 10:09 afpr252

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.

fgimian avatar Sep 14 '22 12:09 fgimian