vscode: Multi monitors: `code -n` doesn't focus on the new window that opens

Running code -n refocuses on the already open window.

It would make more sense for it to focus on the new window. This might just be an issue with how MacOS deals with new windows, I’m not able to test on Windows at the moment.

  • VSCode Version: 1.23.1
  • OS Version: MacOS 10.13.4

Steps to Reproduce:

  1. Open a Code window
  2. Run code -n

Does this issue occur when all extensions are disabled?: Yes

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 20 (12 by maintainers)

Most upvoted comments

@bpasero

  • Have Code open on macOS screen (Main)
  • Open iTerm on external monitor’s screen (External)
  • code -n
  • A new Code window is open at External
  • Focus is back to Code in Main

ive come across another side effect of this same issue. https://github.com/microsoft/vscode/issues/80314 Any instance of a vscode window with a given directory open in it will take focus, regardless of the flags provided when attempting to open another window. in short, if you try to open dir foo twice but use the -n flag it wont even open a new window. also if you try to just open a second window it works fine if the window does not take a path as an argument, but even then trying to open the same dir foo in the newly opened window refocuses the old window.

I think you’re misunderstanding. I want to focus on the newly opened window so I can start typing in it immediately.