You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Windows 10虚拟桌面下VS Code多实例文件打开跳转问题咨询

Fix VS Code Jumping Between Virtual Desktops on Windows 10

Hey there! I totally get how annoying it is when you try to open a file in your current virtual desktop, only for VS Code to yank you over to another desktop where your last instance was running. Let's get this sorted using the exact configuration you spotted (and a couple more reliable tweaks).

Step 1: Open VS Code Settings

First, pull up your VS Code settings:

  • Use the keyboard shortcut Ctrl+, (comma), or
  • Click the gear icon in the bottom-left corner and select Settings.

Step 2: Tweak the Key Configuration

You mentioned the "window.openFilesInNe..." setting—this is almost certainly "window.openFilesInNewInstance", which controls whether VS Code reuses an existing instance or spins up a new one when opening files.

Here's what to do:

  • In the settings search bar, type window.openFilesInNewInstance to locate the setting.
  • Set its value to "on". This tells VS Code to always open files in a new instance on your current virtual desktop, instead of jumping to the last-used instance elsewhere.

If you'd prefer to reuse instances but keep them tied to your current desktop (instead of triggering a switch), you can add this extra tweak:

  • Search for "window.restoreWindows" and set it to "none". This prevents VS Code from restoring previous window states across desktops, pairing nicely with the first setting for a seamless fix.

Test the Fix

After adjusting these settings, try opening a file from your current virtual desktop—it should either open in a new VS Code window right there, or in an existing instance on the same desktop, no unwanted virtual desktop switches required.


内容的提问来源于stack exchange,提问作者Gailius

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.25 03:31:05