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

Ubuntu 20.04虚拟机装Deepin桌面后VS Code自动启动,如何禁用?

Hey there! I get how annoying it is when VS Code pops up automatically every time you boot your Deepin desktop VM. Let’s walk through some straightforward fixes to get rid of this behavior:

How to Disable VS Code Auto-Launch on Deepin Desktop (Ubuntu 20.04)

Method 1: Tweak VS Code's Built-in Settings

First, check if VS Code itself is configured to restore windows on startup:

  • Open VS Code and press Ctrl+, to open the Settings panel.
  • In the search bar, type window.restoreWindows. Change its value from all (the default) to none if you don’t want any windows restored, or folders if you only want to reopen your project folders (but not the full editor window).
  • Also search for startup and look for any option labeled "Open at Login" or similar—make sure this is toggled off.

Method 2: Use Deepin's Startup Applications Manager

Deepin has its own native tool for managing auto-start apps:

  • Open the Deepin Launcher and search for Startup Applications (or its localized equivalent if your system isn’t in English).
  • In the list of apps, look for an entry named "Visual Studio Code" or "Code". If you find it, either uncheck the box next to it to disable auto-launch, or click the delete button to remove it from the list entirely.

Method 3: Manually Remove Auto-Launch Config Files

If the GUI tool doesn’t work, you can directly edit the system’s auto-start configuration files:

  1. Open a terminal and check if there’s a VS Code auto-start file in your user-specific config directory:
    ls ~/.config/autostart
    
  2. If you see a file like code.desktop or visual-studio-code.desktop, delete it with this command:
    rm ~/.config/autostart/code.desktop
    
  3. (Optional) If you don’t find the file in your user directory, check the global auto-start folder (requires sudo access):
    sudo ls /etc/xdg/autostart
    
    If a VS Code entry exists here, delete it using:
    sudo rm /etc/xdg/autostart/code.desktop
    

Method 4: Disable Deepin's Session Restore Feature

Deepin might be restoring your entire previous session (including open apps) on boot:

  • Open Deepin’s System Settings and navigate to the Desktop or Session & Startup section.
  • Look for an option like "Restore previous session" or "Resume last used applications" and toggle it off.
  • Alternatively, make sure to close VS Code properly before shutting down your VM—some desktop environments only restore apps that were open when you logged out or shut down.

If none of these methods resolve the issue, double-check if any VS Code extensions are causing this (though this is rare). You can test this by launching VS Code in safe mode with code --safe-mode; if the auto-launch stops, disable extensions one by one to find the culprit.

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.05.09 11:32:56