Repository: vscode
Issue: Markdown Preview and some extensions work exactly once, then display black screen, when used remotely
Labels: info-needed

Type: <b>Bug</b>

# Markdown Preview and some extensions work exactly once, then display black screen, when used remotely

Markdown Preview, extension mhutchie.git-graph-1.30.0, and extension phil294.git-log--graph-0.1.15 work exactly once, then display black screen. This occurs only when using these while connected remotely using the remote-ssh extension. 
- This problem does NOT occur locally (opening files/folders on the Windows PC).
- This problem does NOT occur with VS Code v1.72.2.
- This problem occurs with version v.1.89.0. However, since that version does not support the version of Linux we are using, I've downgraded to the last version that supports our version of Linux, which is v1.85.2. See also https://code.visualstudio.com/docs/remote/faq#_can-i-run-vs-code-server-on-older-linux-distributions
- The version of Linux used cannot be changed by me, this is outside the scope of my influence.

This problem seems to have been introduced in v1.73.

# This problem is specific to the following host environment
$ uname -srm
Linux 4.14.336-257.568.amzn2.x86_64 x86_64

$ cat /etc/os-release
NAME="Amazon Linux"
VERSION="2"
ID="amzn"
ID_LIKE="centos rhel fedora"
VERSION_ID="2"
PRETTY_NAME="Amazon Linux 2"
ANSI_COLOR="0;33"
CPE_NAME="cpe:2.3:o:amazon:amazon_linux:2"
HOME_URL="https://amazonlinux.com/"
SUPPORT_END="2025-06-30"

$ hostnamectl
   Static hostname: redacted
         Icon name: computer-vm
           Chassis: vm
        Machine ID: redacted
           Boot ID: redacted
    Virtualization: amazon
  Operating System: Amazon Linux 2
       CPE OS Name: cpe:2.3:o:amazon:amazon_linux:2
            Kernel: Linux 4.14.336-257.568.amzn2.x86_64
      Architecture: x86-64

# Steps to reproduce (here: markdown preview)
- Install VS Code, e.g. v1.85.2 on Windows PC
- Install remote-ssh extension
- connect to Amazon Linux EC2 instance running the Linux version described above
- create a markdown file with some basic content (e.g. "# Hello world!") and save it
- right-click on the markdown file, choose "Open preview". The preview is displayed correctly.
- click on the tab of the source markdown file, then back on the tab of the preview. The preview pane is now black.
![vscode_preview_demo](https://github.com/microsoft/vscode/assets/70998910/28fb2de7-e3f2-4443-a65d-87772abb6e52)

# Step to reset the configuration, so that it will work again, but only once
delete the following key in the state.vscdb database: 'memento/mainThreadWebviewPanel.origins'

# This can be automated using the sqlite3 binary from sqlite.org
.\sqlite3 "%APPDATA%\Code1852\userdata\User\globalStorage\state.vscdb" "delete from ItemTable where key = 'memento/mainThreadWebviewPanel.origins';"

# Added by VS Code "report issue"
VS Code version: Code 1.85.2 (8b3775030ed1a69b13e4f4c628c612102e30a681, 2024-01-18T06:40:10.514Z)
OS version: Windows_NT x64 10.0.17763
Modes:
Remote OS version: Linux x64 4.14.336-257.568.amzn2.x86_64

<details>
<summary>System Info</summary>

|Item|Value|
|---|---|
|CPUs|Intel(R) Xeon(R) Gold 6240R CPU @ 2.40GHz (16 x 2394)|
|GPU Status|2d_canvas: unavailable_software<br>canvas_oop_rasterization: disabled_off<br>direct_rendering_display_compositor: disabled_off_ok<br>gpu_compositing: disabled_software<br>multiple_raster_threads: enabled_on<br>opengl: disabled_off<br>rasterization: disabled_software<br>raw_draw: disabled_off_ok<br>video_decode: disabled_software<br>video_encode: disabled_software<br>vulkan: disabled_off<br>webgl: unavailable_software<br>webgl2: unavailable_software<br>webgpu: unavailable_software|
|Load (avg)|undefined|
|Memory (System)|160.00GB (130.45GB free)|
|Process Argv|--extensions-dir=d:\\Users\\redacted\\AppData\\Roaming\\Code1852\\extensions --user-data-dir=d:\\Users\\redacted\\AppData\\Roaming\\Code1852\\userdata --disable-updates|
|Screen Reader|no|
|VM|40%|

|Item|Value|
|---|---|
|Remote|SSH: redacted#redacted|
|OS|Linux x64 4.14.336-257.568.amzn2.x86_64|
|CPUs|Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz (8 x 3108)|
|Memory (System)|30.95GB (24.69GB free)|
|VM|0%|
</details><details><summary>Extensions (3)</summary>

Extension|Author (truncated)|Version
---|---|---
remote-ssh|ms-|0.107.1
remote-ssh-edit|ms-|0.86.0
remote-explorer|ms-|0.4.1


</details>
<!-- generated by issue reporter -->