Remote-SSH: X11 Forwarding breaks on "Reload Window" due to stale DISPLAY variable in persistent server process

Where does the bug appear (feature/product)?

Somewhere else…

Describe the Bug

When using Remote-SSH with X11 forwarding enabled (ForwardX11 yes), reloading the window causes X11 functionality to break. The persistent Cursor Server process retains the DISPLAY environment variable from the original session, failing to update to the new X11 forwarding port assigned by the new SSH connection. only with: “Remote-SSH: kill remove server and reload window” the DISPLAY updates.

Steps to Reproduce

reloading alone won’t always reproduce it, because you may get lucky and get assigned the same DISPLAY. To 100% reproduce (on windows)

  1. have VcXsrv installed & lanuched
  2. have windows DISPLAY env var globally set to 127.0.0.1:0.0
  3. Connect to a remote Linux host via Cursor Remote-SSH with X11 forwarding enabled. (ForwardX11 yes ForwardX11Trusted yes)
  4. Open the integrated terminal -v erify X11 works (e.g., run xclock).
  5. close the remote connection.
  6. Open a new cursor window, and connect to the same host. (or run ssh -x on powershell - this connection “steals” the original connection’s DISPLAY.
  7. reconnect on the first window.
  8. close connection on the second window.
  9. The gui should not work now on the first window.

explanation in short:

  1. The first window gets DISPLAY → then closed & loses it, but keeps the DISPLAY value.
  2. Second connection established - is allocated the same DISPLAY (because its available now)
  3. reconnection in first window (allocated a new DISPLAY by sshd, but has the old one set)
  4. closing the second window → losing the orig DISPLAY → gui wont work on the first window.

Expected Behavior

The DISPLAY variable should match the active X11 forwarding socket of the current SSH connection

Operating System

Windows 10/11

Current Cursor Version (Menu → About Cursor → Copy)

Version: 2.2.44 (user setup)
VSCode Version: 1.105.1
Commit: 20adc1003928b0f1b99305dbaf845656ff81f5d0
Date: 2025-12-24T21:41:47.598Z
Electron: 37.7.0
Chromium: 138.0.7204.251
Node.js: 22.20.0
V8: 13.8.258.32-electron.0
OS: Windows_NT x64 10.0.26100

Does this stop you from using Cursor

Sometimes - I can sometimes use Cursor

Can you try upgrading to 1.0.37 of the Remote SSH extension, which should fix this issue?

1 Like

This topic was automatically closed 22 days after the last reply. New replies are no longer allowed.