danielroedl / vsc-meld-diff

Visual studio code extension to open two files in the external tool meld.
https://marketplace.visualstudio.com/items?itemName=danielroedl.meld-diff
MIT License
12 stars 6 forks source link

error on remote-ssh #10

Open ihakh opened 3 years ago

ihakh commented 3 years ago

when I connect withssh -X to remote develop server I can run meld but with remote-ssh extension and this extension I get this error:

Meld Diff Error: Error running diff command! StdErr: Unable to init server: Could not connect: Connection refused
Unable to init server: Could not connect: Connection refused

(meld:45279): Gtk-CRITICAL **: gtk_icon_theme_get_for_screen: assertion 'GDK_IS_SCREEN (screen)' failed
Traceback (most recent call last):
  File "/usr/bin/meld", line 244, in <module>
    setup_resources()
  File "/usr/bin/meld", line 183, in setup_resources
    Gtk.IconTheme.get_default().append_search_path(icon_dir)
AttributeError: 'NoneType' object has no attribute 'append_search_path'
HIT2022 commented 2 years ago

I'm in the same boat. I'm using VS code on a windows local machine and connected to a remote linux machine (where the repo exists), and meld is attempting to launch on that remote machine, which is headless (hence the error above). Is there a way to direct VS to run the diff of the remote machine's files on the local machine (where both VS and Meld are installed)?

danielroedl commented 2 years ago

When you define the x11 forwarding in your connection it works. By adding a new connection use ssh -X user@host. Check in your ~/.ssh/config if ForwardX11 yes is configured for your added connection.

You can also allow X11 forwarding in general by adding to your ~/.ssh/config:

Host *
  ForwardAgent yes
  ForwardX11 yes

I hope this helps.

Xudong-Huang commented 1 year ago

maybe we can get some idea from https://github.com/mbikovitsky/beyond-ssh.git

DeadRabbits307 commented 6 months ago

for me (I also work remotely) worked following:

Remote X11, Remote Development and Remote X11 (SSH) running

in file ~/.ssh/config I had to add following entry:

Host * 
  SetEnv DISPLAY=localhost:10.0

(the actual number (here 10.0) you can verify by an echo $DISPLAY)

in file /etc/ssh/sshd_config on the remote Linux Workstation

AcceptEnv DISPLAY

Apparently, my used extensions do not contribute the DISPLAYvariable. Why, I don't understand...