vscode icon indicating copy to clipboard operation
vscode copied to clipboard

New windows are blank after VS Code package is upgraded while an older instance is running on Linux

Open LinqLover opened this issue 2 months ago • 6 comments

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

  • VS Code Version: 1.139.0
    • before update: 1.134.0
  • OS Version: Ubuntu 24.04

Steps to Reproduce:

  1. Open at least one VS Code window
  2. Allow apt to update VS Code in the background while it is running
  3. Try to open a new VS Code window (either via Ctrl + Shift + N or via code in a terminal)

Expected:

  • New VS Code window opens and loads

Actual:

  • New VS Code window opens but stays empty, does not react to any mouse clicks or keyboard shortcuts:
Image
  • What does work though is running a new VS Code window via code --user-data-dir=/tmp/vscode-test-instance
  • Existing VS Code windows continue to work
$ ls -l /proc/$(pgrep -o -f '^/usr/share/code/code ')/exe
lrwxrwxrwx 1 christoph christoph 0 Sep 24 13:46 /proc/87005/exe -> '/usr/share/code/code (deleted)'

I have observed this multiple times within the past months, so this is not a one-time upgrade issue but a recurring source of disruption, because I am now forced to restart all open windows (of which I often have a few), including saving unsaved files, etc. (or alternatively killing code so it restores them automatically).

LinqLover avatar Sep 24 '26 11:09 LinqLover

Thanks for creating this issue! It looks like you may be using an old version of VS Code; the latest stable release is 1.139.0. Please try upgrading to the latest version and checking whether this issue remains.

Happy Coding!

Still happens with 1.134.0 --> 1.139.0. Updated above.

LinqLover avatar Sep 24 '26 12:09 LinqLover

Also happened when upgrading from 1.141.0 to 1.142.0 on Ubuntu 26.04.

alexvorndran avatar Oct 16 '26 15:10 alexvorndran

I appreciate the work the team puts into VS Code, but when an update becomes available while older editor windows are still open, this bug occurs every time. The only workaround is to close everything and reopen all my work, which is disruptive.

Updates arrive almost daily, so I hit this constantly. Please either fix the bug or move to a less frequent update schedule. I'm not alone in this: many users are frustrated by the update frequency, and by bugs like this one staying unfixed.

maartenciers avatar Nov 26 '26 09:11 maartenciers

See this problem most weeks on Ubuntu 22.04. Current version installed is 1.148.0 and I've ran into it again at this very moment.

GaryChan1 avatar Nov 27 '26 03:11 GaryChan1

Workaround (kills all outdated code windows, then restarts VS Code):

ps -eo pid=,ppid=,comm= | awk '
    { parent[$1]=$2; name[$1]=$3 }
    END {
        for (pid in name) {
            if (name[pid] != "code") continue
            p = parent[pid]
            while (p > 0 && name[p] != "code")
                p = parent[p]
            if (p == 0) print pid
        }
    }
' | while read -r pid; do
    if [[ $(readlink "/proc/$pid/exe") == *" (deleted)" ]]; then
        kill -TERM "$pid"
    fi
done

Disclaimer: VS Code should have auto-saved any open files, but there might no guarantee. Yet, works for me.

LinqLover avatar Nov 30 '26 21:11 LinqLover