resyntax icon indicating copy to clipboard operation
resyntax copied to clipboard

Need X to run resyntax

Open samdphillips opened this issue 4 years ago • 5 comments

Similar to jeapostrophe/racket-langserver#45

$ resyntax help
Unable to init server: Could not connect: Connection refused
Gtk initialization failed for display ":0"
  context...:
   body of "/usr/local/stow/racket-8.0/share/racket/pkgs/gui-lib/mred/private/wx/gtk/queue.rkt"
   body of "/usr/local/stow/racket-8.0/share/racket/pkgs/gui-lib/mred/private/wx/platform.rkt"

samdphillips avatar Apr 13 '21 01:04 samdphillips

Seems you are very much aware of this state of affairs...

samdphillips avatar Apr 13 '21 01:04 samdphillips

Yup, see #37 for some mentions of the problem to myself. Having a canonical issue for it is good though.

jackfirth avatar Apr 15 '21 20:04 jackfirth

In summary: the problem is that Resyntax depends on DrRacket's code indenter which is entangled with the GUI framework. That's the only reason Resyntax needs a display. If we can reimplement that indenter without GUI dependencies, or extract the current implementation out into a GUI-less API, this problem goes away.

jackfirth avatar Apr 15 '21 20:04 jackfirth

I think this might be fixable now by making Resyntax use the new syntax coloring APIs, specifically those described in syntax-color/racket-indentation.

jackfirth avatar Apr 07 '22 22:04 jackfirth

As mentioned on that other link, there's the work-around of using xvfb-run resyntax to give it a virtual X device.

(On the one hand, this is just a work-around. On the other hand, it's something that anyone using Racket on a headless server probably will need to learn, eventually -- even if you carefully install minimal Racket, it is easy to install something that indirectly depends on gui-lib and it gets installed.)

greghendershott avatar Apr 26 '22 14:04 greghendershott

Fixed by #236.

jackfirth avatar Aug 22 '24 05:08 jackfirth